@@ -25,6 +25,11 @@ function App() {
2525 alert(`Upload failed: ${error.message}`);
2626 };
2727
28+ const copyPrompt = (e: React.MouseEvent<HTMLLIElement>) => {
29+ const text = e.currentTarget.textContent ?? '';
30+ void navigator.clipboard.writeText(text);
31+ };
32+
2833 // Display uploaded image if available, otherwise show a sample
2934 const imageId = uploadedImageId || 'samples/people/bicycle';
3035
@@ -72,16 +77,16 @@ function App() {
7277 <ul className="prompts-list">
7378 {hasUploadPreset ? (
7479 <>
75- <li>Create an image gallery with lazy loading and responsive images</li>
76- <li>Create a video player that plays a Cloudinary video</li>
77- <li>Add image overlays with text or logos</li>
80+ <li onClick={copyPrompt} title="Click to copy" >Create an image gallery with lazy loading and responsive images</li>
81+ <li onClick={copyPrompt} title="Click to copy" >Create a video player that plays a Cloudinary video</li>
82+ <li onClick={copyPrompt} title="Click to copy" >Add image overlays with text or logos</li>
7883 </>
7984 ) : (
8085 <>
81- <li>Let's try uploading — help me add an upload preset and upload widget</li>
82- <li>Create an image gallery with lazy loading and responsive images</li>
83- <li>Create a video player that plays a Cloudinary video</li>
84- <li>Add image overlays with text or logos</li>
86+ <li onClick={copyPrompt} title="Click to copy" >Let's try uploading — help me add an upload preset and upload widget</li>
87+ <li onClick={copyPrompt} title="Click to copy" >Create an image gallery with lazy loading and responsive images</li>
88+ <li onClick={copyPrompt} title="Click to copy" >Create a video player that plays a Cloudinary video</li>
89+ <li onClick={copyPrompt} title="Click to copy" >Add image overlays with text or logos</li>
8590 </>
8691 )}
8792 </ul>
0 commit comments