Implement strict type enforcement plan

This commit is contained in:
gpt-engineer-app[bot]
2025-10-16 14:10:35 +00:00
parent 3bcd9e03fa
commit bc4a444138
25 changed files with 161 additions and 132 deletions

View File

@@ -3,11 +3,11 @@ import { useNavigate } from 'react-router-dom';
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
import { Badge } from '@/components/ui/badge';
import { Button } from '@/components/ui/button';
import { Company } from '@/types/database';
import { CompanyWithStats } from '@/types/database';
import { getCloudflareImageUrl } from '@/lib/cloudflareImageUtils';
interface ManufacturerCardProps {
company: Company;
company: CompanyWithStats;
}
export function ManufacturerCard({ company }: ManufacturerCardProps) {
@@ -67,9 +67,9 @@ export function ManufacturerCard({ company }: ManufacturerCardProps) {
{/* Logo Display */}
<div className="absolute inset-0 flex items-center justify-center">
{(company.logo_url || (company as any).logo_image_id) ? (
<div className="w-16 h-16 md:w-20 md:h-20 bg-background/90 rounded-xl overflow-hidden shadow-lg backdrop-blur-sm border border-border/50">
<div className="w-16 h-16 md:w-20 md:h-20 bg-background/90 rounded-xl overflow-hidden shadow-lg backdrop-blur-sm border border-border/50">
<img
src={company.logo_url || getCloudflareImageUrl((company as any).logo_image_id, 'logo')}
src={company.logo_url || ''}
alt={`${company.name} logo`}
className="w-full h-full object-contain p-2"
loading="lazy"
@@ -123,26 +123,26 @@ export function ManufacturerCard({ company }: ManufacturerCardProps) {
{/* Stats Display */}
<div className="flex flex-wrap gap-x-3 md:gap-x-4 gap-y-1 text-xs md:text-sm">
{(company as any).ride_count > 0 && (
{company.ride_count && company.ride_count > 0 && (
<div className="flex items-center gap-1">
<FerrisWheel className="w-3 h-3 text-muted-foreground" />
<span className="font-medium">{(company as any).ride_count}</span>
<span className="font-medium">{company.ride_count}</span>
<span className="text-muted-foreground">rides</span>
</div>
)}
{(company as any).coaster_count > 0 && (
{company.coaster_count && company.coaster_count > 0 && (
<div className="flex items-center gap-1">
<span className="text-muted-foreground"></span>
<span className="font-medium">{(company as any).coaster_count}</span>
<span className="font-medium">{company.coaster_count}</span>
<span className="text-muted-foreground">coasters</span>
</div>
)}
{(company as any).model_count > 0 && (
{company.model_count && company.model_count > 0 && (
<div className="flex items-center gap-1">
<span className="text-muted-foreground"></span>
<span className="font-medium">{(company as any).model_count}</span>
<span className="font-medium">{company.model_count}</span>
<span className="text-muted-foreground">models</span>
</div>
)}