import { Button } from "@/components/ui/button"; import { Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerTitle, DrawerTrigger, } from "@/components/ui/drawer" import { Textarea } from "./ui/textarea"; import { Share1Icon } from "@radix-ui/react-icons"; import { Input } from "./ui/input"; import React, { useRef } from 'react'; import { useToast } from "./ui/use-toast"; import { Event as NostrEvent, nip19 } from "nostr-tools"; interface ViewCopyButtonProps { event: NostrEvent; } export default function ViewCopyButton({ event }: ViewCopyButtonProps) { const jsonEvent = JSON.stringify(event, null, 2); const inputRef = useRef(null); const inputRefID = useRef(null); const { toast } = useToast() const handleCopyLink = async () => { try { await navigator.clipboard.writeText(window.location.href); toast({ description: 'URL copied to clipboard', title: 'Copied' }); } catch (err) { toast({ description: 'Error copying URL to clipboard', title: 'Error', variant: 'destructive' }); } }; const handleCopyNoteId = async () => { try { await navigator.clipboard.writeText(nip19.noteEncode(event.id)); toast({ description: 'Note ID copied to clipboard', title: 'Copied' }); } catch (err) { toast({ description: 'Error copying Note ID to clipboard', title: 'Error', variant: 'destructive' }); } }; return ( Share this Note Share this Note with others.
{/*

URL

*/}
); }