import * as React from "react"; import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogFooter, } from "@/components/ui/dialog"; import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input"; import { Label } from "@/components/ui/label"; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from "@/components/ui/select"; import { Spinner } from "@/components/ui/spinner"; import { AddressAutocomplete } from "@/components/ui/form-primitives"; // --------------------------------------------------------------------------- // Types // --------------------------------------------------------------------------- export interface CreateContactFormData { firstName: string; lastName: string; email: string; phone: string; address?: string; assignedStaffId?: string; } export interface StaffOption { id: string; displayName: string; } export interface CreateContactModalProps { open: boolean; onOpenChange: (open: boolean) => void; onSubmit: (data: CreateContactFormData) => void; isLoading?: boolean; /** When provided, renders an "Assign to" staff selector (Admin role). */ staffOptions?: StaffOption[]; className?: string; } // --------------------------------------------------------------------------- // Helpers // --------------------------------------------------------------------------- function Field({ id, label, required, children, }: { id: string; label: string; required?: boolean; children: React.ReactNode; }) { return (