From a6d6647bb2bf56d509bff31d176616abe078dcee Mon Sep 17 00:00:00 2001 From: Matt Ciaccio Date: Fri, 24 Apr 2026 14:27:47 +0200 Subject: [PATCH] refactor(clients): strip yacht/company/proxy sections from client form --- src/components/clients/client-form.tsx | 142 ++++--------------------- 1 file changed, 22 insertions(+), 120 deletions(-) diff --git a/src/components/clients/client-form.tsx b/src/components/clients/client-form.tsx index 122bec6..9d4fa3d 100644 --- a/src/components/clients/client-form.tsx +++ b/src/components/clients/client-form.tsx @@ -16,13 +16,7 @@ import { SelectTrigger, SelectValue, } from '@/components/ui/select'; -import { - Sheet, - SheetContent, - SheetHeader, - SheetTitle, - SheetFooter, -} from '@/components/ui/sheet'; +import { Sheet, SheetContent, SheetHeader, SheetTitle, SheetFooter } from '@/components/ui/sheet'; import { Checkbox } from '@/components/ui/checkbox'; import { Separator } from '@/components/ui/separator'; import { TagPicker } from '@/components/shared/tag-picker'; @@ -36,13 +30,7 @@ interface ClientFormProps { client?: { id: string; fullName: string; - companyName?: string | null; nationality?: string | null; - isProxy?: boolean; - proxyType?: string | null; - actualOwnerName?: string | null; - yachtName?: string | null; - berthSizeDesired?: string | null; preferredContactMethod?: string | null; preferredLanguage?: string | null; timezone?: string | null; @@ -53,6 +41,7 @@ interface ClientFormProps { value: string; label?: string | null; isPrimary?: boolean; + notes?: string | null; }>; tags?: Array<{ id: string }>; }; @@ -75,13 +64,11 @@ export function ClientForm({ open, onOpenChange, client }: ClientFormProps) { defaultValues: { fullName: '', contacts: [{ channel: 'email', value: '', isPrimary: true }], - isProxy: false, tagIds: [], }, }); const { fields, append, remove } = useFieldArray({ control, name: 'contacts' }); - const isProxy = watch('isProxy'); const tagIds = watch('tagIds') ?? []; // Populate form when editing @@ -89,14 +76,10 @@ export function ClientForm({ open, onOpenChange, client }: ClientFormProps) { if (client && open) { reset({ fullName: client.fullName, - companyName: client.companyName ?? undefined, nationality: client.nationality ?? undefined, - isProxy: client.isProxy ?? false, - proxyType: client.proxyType ?? undefined, - actualOwnerName: client.actualOwnerName ?? undefined, - yachtName: client.yachtName ?? undefined, - berthSizeDesired: client.berthSizeDesired ?? undefined, - preferredContactMethod: (client.preferredContactMethod as CreateClientInput['preferredContactMethod']) ?? undefined, + preferredContactMethod: + (client.preferredContactMethod as CreateClientInput['preferredContactMethod']) ?? + undefined, preferredLanguage: client.preferredLanguage ?? undefined, timezone: client.timezone ?? undefined, source: (client.source as CreateClientInput['source']) ?? undefined, @@ -108,6 +91,7 @@ export function ClientForm({ open, onOpenChange, client }: ClientFormProps) { value: c.value, label: c.label ?? undefined, isPrimary: c.isPrimary ?? false, + notes: c.notes ?? undefined, })) : [{ channel: 'email', value: '', isPrimary: true }], tagIds: client.tags?.map((t) => t.id) ?? [], @@ -116,7 +100,6 @@ export function ClientForm({ open, onOpenChange, client }: ClientFormProps) { reset({ fullName: '', contacts: [{ channel: 'email', value: '', isPrimary: true }], - isProxy: false, tagIds: [], }); } @@ -151,10 +134,7 @@ export function ClientForm({ open, onOpenChange, client }: ClientFormProps) { {isEdit ? 'Edit Client' : 'New Client'} -
mutation.mutate(data))} - className="space-y-6 py-6" - > + mutation.mutate(data))} className="space-y-6 py-6"> {/* Basic Info */}

@@ -170,11 +150,6 @@ export function ClientForm({ open, onOpenChange, client }: ClientFormProps) { )}

-
- - -
-
@@ -194,9 +169,7 @@ export function ClientForm({ open, onOpenChange, client }: ClientFormProps) { type="button" variant="outline" size="sm" - onClick={() => - append({ channel: 'email', value: '', isPrimary: false }) - } + onClick={() => append({ channel: 'email', value: '', isPrimary: false })} > Add Contact @@ -218,7 +191,10 @@ export function ClientForm({ open, onOpenChange, client }: ClientFormProps) { setValue('proxyType', v)} - > - - - - - Broker - Representative - Family Member - Legal Counsel - Other - - -
-
- - -
- - )} - - - - - {/* Yacht Details */} -
-

- Yacht Details -

-
-
- - -
-
- - -
-
-
- - - {/* Source & Preferences */}

@@ -357,7 +265,9 @@ export function ClientForm({ open, onOpenChange, client }: ClientFormProps) { setValue('preferredContactMethod', v as 'email' | 'phone' | 'whatsapp')} + onValueChange={(v) => + setValue('preferredContactMethod', v as 'email' | 'phone' | 'whatsapp') + } > @@ -396,10 +308,7 @@ export function ClientForm({ open, onOpenChange, client }: ClientFormProps) {

- +
@@ -409,18 +318,11 @@ export function ClientForm({ open, onOpenChange, client }: ClientFormProps) { {/* Tags */}
- setValue('tagIds', ids)} - /> + setValue('tagIds', ids)} />
-