fix(types): loosen icon component type for lucide-react compat

This commit is contained in:
2026-05-31 21:57:42 +01:00
parent fbea75fac6
commit 8913d2f341
+4 -3
View File
@@ -245,7 +245,8 @@ const AMENITY_ICONS: Record<string, string> = {
}; };
// ─── Stop meta (icon + accent colour per type) ─────────────────────────────── // ─── Stop meta (icon + accent colour per type) ───────────────────────────────
function stopMeta(type: StopType): { icon: React.ComponentType<{ className?: string; size?: number }>; color: string } { type IconComponent = React.ComponentType<{ className?: string; size?: number | string }>;
function stopMeta(type: StopType): { icon: IconComponent; color: string } {
switch (type) { switch (type) {
case 'origin': return { icon: HomeIcon, color: '#9ca3af' }; case 'origin': return { icon: HomeIcon, color: '#9ca3af' };
case 'destination': return { icon: Flag, color: 'var(--gd-red)' }; case 'destination': return { icon: Flag, color: 'var(--gd-red)' };
@@ -695,7 +696,7 @@ const VARIANT_TONE: Record<RouteVariant['tone'], string> = {
blue: 'var(--gd-blue)', blue: 'var(--gd-blue)',
}; };
const VARIANT_ICON: Record<RouteVariant['id'], React.ComponentType<{ className?: string; size?: number }>> = { const VARIANT_ICON: Record<RouteVariant['id'], IconComponent> = {
fast: Gauge, fast: Gauge,
scenic: TreePine, scenic: TreePine,
cheap: Euro, cheap: Euro,
@@ -2566,7 +2567,7 @@ function CustomiseStopModal({
const [pickedNearby, setPickedNearby] = React.useState<Set<string>>(new Set()); const [pickedNearby, setPickedNearby] = React.useState<Set<string>>(new Set());
const [chosenChargerId, setChosenChargerId] = React.useState<string>(stop.chargerOptions?.find(c => c.isCurrent)?.id || stop.chargerOptions?.[0]?.id || ''); const [chosenChargerId, setChosenChargerId] = React.useState<string>(stop.chargerOptions?.find(c => c.isCurrent)?.id || stop.chargerOptions?.[0]?.id || '');
const tabs: { id: CustomiseTab; label: string; icon: React.ComponentType<{ className?: string; size?: number }>; count?: number; show: boolean }[] = [ const tabs: { id: CustomiseTab; label: string; icon: IconComponent; count?: number; show: boolean }[] = [
{ id: 'charger', label: 'Charger', icon: Zap, count: stop.chargerOptions?.length, show: isCharge }, { id: 'charger', label: 'Charger', icon: Zap, count: stop.chargerOptions?.length, show: isCharge },
{ id: 'overnight', label: 'Overnight', icon: Bed, count: stop.alternatives?.length, show: isSleep }, { id: 'overnight', label: 'Overnight', icon: Bed, count: stop.alternatives?.length, show: isSleep },
{ id: 'duration', label: 'Duration', icon: Clock, show: true }, { id: 'duration', label: 'Duration', icon: Clock, show: true },