'use client'; import { MoreHorizontal, X } from 'lucide-react'; import { toast } from 'sonner'; import { deleteBoard } from '@/actions/delete-board'; import { useAction } from '@/hooks/use-action'; import { Button } from '@/components/ui/button'; import { Popover, PopoverClose, PopoverContent, PopoverTrigger, } from '@/components/ui/popover'; import { copyBoard } from '@/actions/copy-board'; interface BoardOptionsProps { id: string; } export const BoardOptions = ({ id }: BoardOptionsProps) => { const { execute: executeDelete, isLoading: isLoadingDelete } = useAction( deleteBoard, { onError: (error) => { toast.error(error); }, } ); const { execute: executeCopy, isLoading: isLoadingCopy } = useAction( copyBoard, { onError: (error) => { toast.error(error); }, } ); const onDelete = () => { executeDelete({ id }); }; const onCopy = () => { executeCopy({ id }); }; return (
Board Actions
); };