feat(forms): country→timezone autoset, "Other" channel hint, polish
Client form: when nationality is picked and timezone empty, primary IANA zone for the country is pre-filled (skips when user has chosen a zone explicitly). When a contact's preferred channel is `'other'`, the inline `Label` field flips to "Specify" / "e.g. Telegram, Signal" so the rep records what the channel actually is. Yacht form: replace the free-text 2-letter flag input with the shared `CountryCombobox` so flags stay valid ISO codes. User settings: timezone pre-populates from `Intl.DateTimeFormat().resolvedOptions().timeZone` on first load (was empty before); country change auto-fills timezone with the same helper as the client form. Phone field upgraded to the shared `<PhoneInput>` (country-flag dropdown + AsYouType formatter) seeded from the page's country state. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -19,6 +19,7 @@ import {
|
||||
} from '@/components/ui/select';
|
||||
import { Sheet, SheetContent, SheetHeader, SheetTitle, SheetFooter } from '@/components/ui/sheet';
|
||||
import { Separator } from '@/components/ui/separator';
|
||||
import { CountryCombobox } from '@/components/shared/country-combobox';
|
||||
import { OwnerPicker, type OwnerRef } from '@/components/shared/owner-picker';
|
||||
import { TagPicker } from '@/components/shared/tag-picker';
|
||||
import { apiFetch } from '@/lib/api/client';
|
||||
@@ -185,7 +186,12 @@ export function YachtForm({ open, onOpenChange, yacht, initialOwner }: YachtForm
|
||||
|
||||
<div className="space-y-1">
|
||||
<Label>Flag</Label>
|
||||
<Input {...register('flag')} placeholder="e.g. MT" />
|
||||
<CountryCombobox
|
||||
value={watch('flag') ?? null}
|
||||
onChange={(iso) => setValue('flag', iso ?? undefined)}
|
||||
placeholder="Select flag country…"
|
||||
clearable
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="space-y-1">
|
||||
|
||||
Reference in New Issue
Block a user