import { X } from 'lucide-react'; import { toast } from 'sonner'; import { useRef } from 'react'; import Link from 'next/link'; import { Button } from '@/components/ui/button'; import { Popover, PopoverClose, PopoverContent, PopoverTrigger, } from '@/components/ui/popover'; import { FormPicker } from '@/components/form/form-picker'; import { FormSubmit } from '@/components/form/form-submit'; import { useAction } from '@/hooks/use-action'; import { updateBoard } from '@/actions/update-board'; interface BoardUpdateImageProps { boardId: string; } export const BoardUpdateImage = ({ boardId }: BoardUpdateImageProps) => { const closeRef = useRef(null); const { execute, fieldErrors } = useAction(updateBoard, { onSuccess: (data) => { toast.success('Board image updated'); closeRef.current?.click(); }, onError: (error) => { toast.error(error); }, }); const onSubmit = (formData: FormData) => { const image = formData.get('image') as string; execute({ id: boardId, image }); }; return (

Images Provided by{' '} Unsplash

Update
); };