"use client"; import { Button } from "@/components/ui/button"; import { Dialog, DialogContent, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, } from "@/components/ui/dialog"; import { z } from "zod"; import { Controller, useForm } from "react-hook-form"; import { zodResolver } from "@hookform/resolvers/zod"; import { Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, } from "@/components/ui/form"; import { Input } from "@/components/ui/input"; import { Checkbox } from "@/components/ui/checkbox"; import { Fragment, useEffect, useState } from "react"; import { useTranslations } from "next-intl"; import { Card } from "@/components/ui/card"; const wilayahList = [ { id: "mabes", label: "Mabes" }, { id: "polda", label: "Polda" }, { id: "satker", label: "Satker" }, ]; const jumlahList = [5, 10, 15, 20, 25, 30]; export default function CreateSettingTracking() { const t = useTranslations("Menu"); const [isOpen, setIsOpen] = useState(false); const form = useForm({ defaultValues: { wilayah: [] as string[], jumlah: [] as number[], }, }); const onSubmit = (values: any) => { console.log("Submitted values:", values); setIsOpen(false); }; return ( <>
{/* Wilayah */} ( Wilayah
{wilayahList.map((item) => (
{ const updated = checked ? [...field.value, item.id] : field.value.filter((val) => val !== item.id); field.onChange(updated); }} />
))}
)} /> ( Jumlah Tracking Berita Harian
)} />
); }