diff --git a/src/pages/ShareStory.tsx b/src/pages/ShareStory.tsx index 72c80a5..884e01a 100644 --- a/src/pages/ShareStory.tsx +++ b/src/pages/ShareStory.tsx @@ -2,7 +2,7 @@ import React, { useState, useEffect, useRef } from 'react'; import { useNavigate } from 'react-router-dom'; import { toast } from 'react-hot-toast'; import { auth } from '../lib/firebase'; -import { Edit, Trash2, CheckSquare, Loader2, Sparkles } from 'lucide-react'; +import { Edit, Trash2, CheckSquare, Loader2, Sparkles, Copy } from 'lucide-react'; import { User } from 'firebase/auth'; // Firebase imports @@ -370,6 +370,19 @@ export default function ShareStory() { }); }; + const handleCopyStory = async (text: string) => { + if (!navigator.clipboard) { + toast.error('Clipboard API not available'); + return; + } + try { + await navigator.clipboard.writeText(text); + toast.success('Story copied to clipboard!'); + } catch (err) { + toast.error('Failed to copy story.'); + } + }; + const handleSubmit = async (e: React.FormEvent) => { e.preventDefault(); setLoading(true); @@ -850,7 +863,15 @@ export default function ShareStory() { Reactions: {story.reactionsCount} {/* Action Buttons */} -
{/* Adjusted spacing */} +
+ {/* Copy Button */} + {/* Grammar Fix Button (for existing stories) */}