feat: Implement complete plan for "coming soon" placeholders

This commit is contained in:
gpt-engineer-app[bot]
2025-10-16 14:47:18 +00:00
parent 8d26ac0749
commit 198742e165
7 changed files with 1123 additions and 69 deletions

View File

@@ -22,7 +22,11 @@ import { Combobox } from '@/components/ui/combobox';
import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from '@/components/ui/dialog';
import { useOperators, usePropertyOwners } from '@/hooks/useAutocompleteData';
import { useUserRole } from '@/hooks/useUserRole';
import { useAuth } from '@/hooks/useAuth';
import type { TempCompanyData } from '@/types/company';
import { LocationSearch } from './LocationSearch';
import { OperatorForm } from './OperatorForm';
import { PropertyOwnerForm } from './PropertyOwnerForm';
const parkSchema = z.object({
name: z.string().min(1, 'Park name is required'),
@@ -112,14 +116,16 @@ export function ParkForm({ onSubmit, onCancel, initialData, isEditing = false }:
validateSubmissionHandler(onSubmit, 'park');
}, [onSubmit]);
const { user } = useAuth();
// Operator state
const [selectedOperatorId, setSelectedOperatorId] = useState<string>(initialData?.operator_id || '');
const [tempNewOperator, setTempNewOperator] = useState<{ name: string; slug: string; company_type: string } | null>(null);
const [tempNewOperator, setTempNewOperator] = useState<TempCompanyData | null>(null);
const [isOperatorModalOpen, setIsOperatorModalOpen] = useState(false);
// Property Owner state
const [selectedPropertyOwnerId, setSelectedPropertyOwnerId] = useState<string>(initialData?.property_owner_id || '');
const [tempNewPropertyOwner, setTempNewPropertyOwner] = useState<{ name: string; slug: string; company_type: string } | null>(null);
const [tempNewPropertyOwner, setTempNewPropertyOwner] = useState<TempCompanyData | null>(null);
const [isPropertyOwnerModalOpen, setIsPropertyOwnerModalOpen] = useState(false);
// Fetch data
@@ -488,29 +494,33 @@ export function ParkForm({ onSubmit, onCancel, initialData, isEditing = false }:
</div>
</form>
{/* Operator Modal - Placeholder */}
{/* Operator Modal */}
<Dialog open={isOperatorModalOpen} onOpenChange={setIsOperatorModalOpen}>
<DialogContent className="max-w-2xl max-h-[90vh] overflow-y-auto">
<DialogHeader>
<DialogTitle>Create New Operator</DialogTitle>
<DialogDescription>
Add a new park operator company
</DialogDescription>
</DialogHeader>
<p className="text-muted-foreground">Operator form coming soon...</p>
<DialogContent className="max-w-4xl max-h-[90vh] overflow-y-auto">
<OperatorForm
initialData={tempNewOperator}
onSubmit={(data) => {
setTempNewOperator(data);
setIsOperatorModalOpen(false);
setValue('operator_id', 'temp-operator');
}}
onCancel={() => setIsOperatorModalOpen(false)}
/>
</DialogContent>
</Dialog>
{/* Property Owner Modal - Placeholder */}
{/* Property Owner Modal */}
<Dialog open={isPropertyOwnerModalOpen} onOpenChange={setIsPropertyOwnerModalOpen}>
<DialogContent className="max-w-2xl max-h-[90vh] overflow-y-auto">
<DialogHeader>
<DialogTitle>Create New Property Owner</DialogTitle>
<DialogDescription>
Add a new park property owner company
</DialogDescription>
</DialogHeader>
<p className="text-muted-foreground">Property owner form coming soon...</p>
<DialogContent className="max-w-4xl max-h-[90vh] overflow-y-auto">
<PropertyOwnerForm
initialData={tempNewPropertyOwner}
onSubmit={(data) => {
setTempNewPropertyOwner(data);
setIsPropertyOwnerModalOpen(false);
setValue('property_owner_id', 'temp-property-owner');
}}
onCancel={() => setIsPropertyOwnerModalOpen(false)}
/>
</DialogContent>
</Dialog>
</CardContent>