"use client"; import { useForm } from "react-hook-form"; import { zodResolver } from "@hookform/resolvers/zod"; import { z } from "zod"; import { organizationSchema } from "@/shared/schemas/organization"; import { Button } from "@/shared/components/ui/button"; import { Form, FormControl, FormField, FormItem, FormLabel, FormMessage, } from "@/shared/components/ui/form"; import { Input } from "@/shared/components/ui/input"; import { Switch } from "@/shared/components/ui/switch"; import { ImageUpload } from "@/shared/components/image-upload"; import { Textarea } from "@/shared/components/ui/textarea"; import { Organization } from "@/shared/types/organization"; type OrganizationFormValues = z.infer; interface OrganizationFormProps { defaultValues?: Partial; onSubmitAction: (data: OrganizationFormValues) => void; isSubmitting?: boolean; onCancelAction?: () => void; } export function OrganizationForm({ defaultValues, onSubmitAction, isSubmitting, onCancelAction, }: OrganizationFormProps) { const form = useForm({ resolver: zodResolver(organizationSchema), defaultValues: { name: defaultValues?.name || "", description: defaultValues?.description || "", thumbnail: defaultValues?.thumbnail || "", address: defaultValues?.address || "", phone_number: defaultValues?.phone_number || "", email: defaultValues?.email || "", website: defaultValues?.website || "", is_active: defaultValues?.is_active ?? true, }, }); return (
( Nama Perangkat Daerah )} /> ( Deskripsi