mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-22 04:11:13 -05:00
Fix: Resolve type errors in Ride and Profile components
This commit is contained in:
@@ -3,6 +3,7 @@ import { useForm } from 'react-hook-form';
|
||||
import { zodResolver } from '@hookform/resolvers/zod';
|
||||
import * as z from 'zod';
|
||||
import { validateSubmissionHandler } from '@/lib/entityFormValidation';
|
||||
import type { RideTechnicalSpec, RideCoasterStat, RideNameHistory } from '@/types/database';
|
||||
import { entitySchemas } from '@/lib/entityValidationSchemas';
|
||||
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
|
||||
import { Button } from '@/components/ui/button';
|
||||
@@ -133,10 +134,31 @@ export function RideForm({ onSubmit, onCancel, initialData, isEditing = false }:
|
||||
const [isManufacturerModalOpen, setIsManufacturerModalOpen] = useState(false);
|
||||
const [isModelModalOpen, setIsModelModalOpen] = useState(false);
|
||||
|
||||
// Advanced editor state
|
||||
const [technicalSpecs, setTechnicalSpecs] = useState<RideTechnicalSpec[]>([]);
|
||||
const [coasterStats, setCoasterStats] = useState<RideCoasterStat[]>([]);
|
||||
const [formerNames, setFormerNames] = useState<RideNameHistory[]>([]);
|
||||
// Advanced editor state - using simplified interface for editors (DB fields added on submit)
|
||||
const [technicalSpecs, setTechnicalSpecs] = useState<{
|
||||
spec_name: string;
|
||||
spec_value: string;
|
||||
spec_type: 'string' | 'number' | 'boolean' | 'date';
|
||||
category?: string;
|
||||
unit?: string;
|
||||
display_order: number;
|
||||
}[]>([]);
|
||||
const [coasterStats, setCoasterStats] = useState<{
|
||||
stat_name: string;
|
||||
stat_value: number;
|
||||
unit?: string;
|
||||
category?: string;
|
||||
description?: string;
|
||||
display_order: number;
|
||||
}[]>([]);
|
||||
const [formerNames, setFormerNames] = useState<{
|
||||
former_name: string;
|
||||
date_changed?: Date | null;
|
||||
reason?: string;
|
||||
from_year?: number;
|
||||
to_year?: number;
|
||||
order_index: number;
|
||||
}[]>([]);
|
||||
|
||||
// Fetch data
|
||||
const { manufacturers, loading: manufacturersLoading } = useManufacturers();
|
||||
|
||||
Reference in New Issue
Block a user