diff --git a/src/pages/ShareStory.tsx b/src/pages/ShareStory.tsx index a07512f..1390d91 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 { EmergencyModal } from '../components/EmergencyModal'; import { User } from 'firebase/auth'; @@ -372,6 +372,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); @@ -858,7 +871,15 @@ export default function ShareStory() { Reactions: {story.reactionsCount} {/* Action Buttons */} -