diff --git a/apps/webapp/app/components/logs/log-options.tsx b/apps/webapp/app/components/logs/log-options.tsx index 8a3b132..be7bead 100644 --- a/apps/webapp/app/components/logs/log-options.tsx +++ b/apps/webapp/app/components/logs/log-options.tsx @@ -1,4 +1,4 @@ -import { EllipsisVertical, Trash } from "lucide-react"; +import { EllipsisVertical, Trash, Copy } from "lucide-react"; import { DropdownMenu, DropdownMenuContent, @@ -18,6 +18,7 @@ import { } from "../ui/alert-dialog"; import { useState, useEffect } from "react"; import { useFetcher, useNavigate } from "@remix-run/react"; +import { toast } from "~/hooks/use-toast"; interface LogOptionsProps { id: string; @@ -40,6 +41,23 @@ export const LogOptions = ({ id }: LogOptionsProps) => { setDeleteDialogOpen(false); }; + const handleCopy = async () => { + try { + await navigator.clipboard.writeText(id); + toast({ + title: "Copied", + description: "Episode ID copied to clipboard", + }); + } catch (err) { + console.error("Failed to copy:", err); + toast({ + title: "Error", + description: "Failed to copy ID", + variant: "destructive", + }); + } + }; + useEffect(() => { if (deleteFetcher.state === "idle" && deleteFetcher.data?.success) { navigate(`/home/inbox`); @@ -48,16 +66,26 @@ export const LogOptions = ({ id }: LogOptionsProps) => { return ( <> - +
+ + +
diff --git a/apps/webapp/app/components/spaces/space-options.tsx b/apps/webapp/app/components/spaces/space-options.tsx index d2170c3..95fc0ba 100644 --- a/apps/webapp/app/components/spaces/space-options.tsx +++ b/apps/webapp/app/components/spaces/space-options.tsx @@ -1,4 +1,4 @@ -import { EllipsisVertical, RefreshCcw, Trash, Edit } from "lucide-react"; +import { EllipsisVertical, RefreshCcw, Trash, Edit, Copy } from "lucide-react"; import { DropdownMenu, DropdownMenuContent, @@ -19,6 +19,7 @@ import { import { useEffect, useState } from "react"; import { useFetcher, useNavigate } from "@remix-run/react"; import { EditSpaceDialog } from "./edit-space-dialog.client"; +import { toast } from "~/hooks/use-toast"; interface SpaceOptionsProps { id: string; @@ -64,6 +65,23 @@ export const SpaceOptions = ({ id, name, description }: SpaceOptionsProps) => { // revalidator.revalidate(); }; + const handleCopy = async () => { + try { + await navigator.clipboard.writeText(id); + toast({ + title: "Copied", + description: "Space ID copied to clipboard", + }); + } catch (err) { + console.error("Failed to copy:", err); + toast({ + title: "Error", + description: "Failed to copy ID", + variant: "destructive", + }); + } + }; + return ( <> @@ -79,6 +97,11 @@ export const SpaceOptions = ({ id, name, description }: SpaceOptionsProps) => { + + + setEditDialogOpen(true)}>