import { useState, type ReactNode } from "react"; import { Hash } from "lucide-react"; import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle, DialogTrigger, } from "@/components/ui/dialog"; import { Input } from "@/components/ui/input"; import { Label } from "@/components/ui/label"; import { Button } from "@/components/ui/button"; import { Textarea } from "@/components/ui/textarea"; import type { DropdownSetting } from "@/types/dropdownSettings"; export interface EditDropdownSettingDialogProps { mode?: "create" | "edit"; setting?: DropdownSetting; children: ReactNode; } export default function EditDropdownSettingDialog({ mode = "create", setting, children, }: EditDropdownSettingDialogProps) { const isEdit = mode === "edit"; const [multiple, setMultiple] = useState(setting?.multiple ?? false); const [searchable, setSearchable] = useState( setting?.meta?.searchable ?? false, ); const [clearable, setClearable] = useState( setting?.meta?.clearable ?? false, ); return ( {children} {isEdit ? "Edit Dropdown Setting" : "New Dropdown Setting"} {isEdit ? "Update the metadata for this dropdown setting." : "Define a new dynamic dropdown that admins can manage."}

Stable identifier used in code. Use snake_case.