mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-21 01: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 { FerrisWheel, 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 { submitOperatorCreation, submitOperatorUpdate } from '@/lib/entitySubmissionHelpers';
|
||||
@@ -58,7 +57,6 @@ interface OperatorFormProps {
|
||||
|
||||
export function OperatorForm({ onSubmit, onCancel, initialData }: OperatorFormProps) {
|
||||
const { isModerator } = useUserRole();
|
||||
const { headquarters } = useCompanyHeadquarters();
|
||||
const { user } = useAuth();
|
||||
const navigate = useNavigate();
|
||||
|
||||
@@ -199,14 +197,13 @@ export function OperatorForm({ onSubmit, onCancel, initialData }: OperatorFormPr
|
||||
|
||||
<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