mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-22 22:51:13 -05:00
feat: Add HeadquartersLocationInput component
This commit is contained in:
@@ -12,9 +12,8 @@ import { RadioGroup, RadioGroupItem } from '@/components/ui/radio-group';
|
||||
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
|
||||
import { SlugField } from '@/components/ui/slug-field';
|
||||
import { Building2, Save, X } from 'lucide-react';
|
||||
import { Combobox } from '@/components/ui/combobox';
|
||||
import { useCompanyHeadquarters } from '@/hooks/useAutocompleteData';
|
||||
import { useUserRole } from '@/hooks/useUserRole';
|
||||
import { HeadquartersLocationInput } from './HeadquartersLocationInput';
|
||||
import { EntityMultiImageUploader, ImageAssignments } from '@/components/upload/EntityMultiImageUploader';
|
||||
import { FlexibleDateInput, type DatePrecision } from '@/components/ui/flexible-date-input';
|
||||
import { submitManufacturerCreation, submitManufacturerUpdate } from '@/lib/entitySubmissionHelpers';
|
||||
@@ -59,7 +58,6 @@ interface ManufacturerFormProps {
|
||||
|
||||
export function ManufacturerForm({ onSubmit, onCancel, initialData }: ManufacturerFormProps) {
|
||||
const { isModerator } = useUserRole();
|
||||
const { headquarters } = useCompanyHeadquarters();
|
||||
const { user } = useAuth();
|
||||
const navigate = useNavigate();
|
||||
|
||||
@@ -200,14 +198,13 @@ export function ManufacturerForm({ onSubmit, onCancel, initialData }: Manufactur
|
||||
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="headquarters_location">Headquarters Location</Label>
|
||||
<Combobox
|
||||
options={headquarters}
|
||||
value={watch('headquarters_location')}
|
||||
onValueChange={(value) => setValue('headquarters_location', value)}
|
||||
placeholder="Select or type location"
|
||||
searchPlaceholder="Search locations..."
|
||||
emptyText="No locations found"
|
||||
<HeadquartersLocationInput
|
||||
value={watch('headquarters_location') || ''}
|
||||
onChange={(value) => setValue('headquarters_location', value)}
|
||||
/>
|
||||
<p className="text-xs text-muted-foreground">
|
||||
Search OpenStreetMap for accurate location data, or manually enter location name.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user