@@ -1588,7 +1692,7 @@ export default function ProchainsDepartsClient({
+
desservies par le {item.modeIcon === 'bus' ? 'CAR' : 'TRAIN'} {(item.modeLabel || 'MOBIGO').toUpperCase().replace(/^(TRAIN|CAR)\s+/i, '')} {item.trainNumber || ''}
@@ -1600,34 +1704,74 @@ export default function ProchainsDepartsClient({
{item.trainBadge}
)}
+ {item.isTrainSupplementaire && (
+
+ Train Supplémentaire
+
+ )}
{item.operator || 'Opéré par SNCF Voyageurs - 1187'}
- {/* Information description box with full HTML support */}
- {item.perturbationDetails && (
-
-
-
- i
-
- Information :
-
- {/<[a-z][\s\S]*>/i.test(item.perturbationDetails) ? (
-
- ) : (
-
- {item.perturbationDetails}
-
- )}
-
- )}
+ {/* Perturbation Banner & Details in Timetable Accordion */}
+ {hasInfo && (() => {
+ const priority = getPerturbationPriority({
+ isSupprime: item.isSupprime,
+ hasParcoursModification: item.perturbationType === 'parcours_modifie' || item.perturbationType?.includes('parcours'),
+ perturbationType: item.perturbationType,
+ delayMinutes: item.revisedTime ? 1 : undefined,
+ });
+ if (priority === 'a_l_heure' && item.perturbationType !== 'information' && !item.perturbationDetails) return null;
+ const bStyle = getPerturbationBannerStyle(priority === 'a_l_heure' ? 'information' : priority);
+ const headerTitle = item.delayText || (
+ priority === 'suppression'
+ ? 'Train supprimé'
+ : priority === 'parcours_modifie'
+ ? 'Modification de parcours'
+ : priority === 'retard'
+ ? 'Retard estimé'
+ : 'Information trafic'
+ );
- {/* Table of stops with 100% continuous yellow line */}
+ return (
+
+
+
+ {bStyle.iconText}
+
+ {headerTitle}
+
+
+ {item.perturbationDetails && (
+
+ {/<[a-z][\s\S]*>/i.test(item.perturbationDetails) ? (
+
+ ) : (
+
+ {item.perturbationDetails}
+
+ )}
+
+ )}
+
+ );
+ })()}
+
+ {/* Table of stops with 100% continuous yellow line (Matching Image 1) */}
{/* Table Subheader */}
@@ -1657,7 +1801,7 @@ export default function ProchainsDepartsClient({
>
{/* Column 1: Green circular radio selector ring */}
- {!isOrigin && (
+ {!isOrigin && !stop.isSupprime && (
- {/* Column 2: Departure time */}
-
{
- if (!isOrigin) setSelectedArrivalStops(prev => ({ ...prev, [item.id]: stop.gareNom }));
- }}
- className={`font-normal text-gray-900 ${!isOrigin ? 'cursor-pointer' : ''}`}
- >
- {stop.departTime || stop.arriveeTime}
-
+ {/* Column 2: Departure time (always displayed, struck-through if suppressed as requested) */}
+
+ {stop.isSupprime ? (
+
+ {stop.departTime || stop.arriveeTime}
+
+ ) : stop.retardMinutes ? (
+
+
+ {stop.departTime || stop.arriveeTime}
+
+
+ {(() => {
+ const [sH, sM] = (stop.departTime || stop.arriveeTime || '00:00').split(':').map(Number);
+ const total = sH * 60 + sM + stop.retardMinutes;
+ const rH = Math.floor(total / 60) % 24;
+ const rM = total % 60;
+ return `${String(rH).padStart(2, '0')}:${String(rM).padStart(2, '0')}`;
+ })()}
+
+
+ ) : (
+
{
+ if (!isOrigin && !stop.isSupprime) setSelectedArrivalStops(prev => ({ ...prev, [item.id]: stop.gareNom }));
+ }}
+ className={`font-normal text-gray-900 ${!isOrigin ? 'cursor-pointer' : ''}`}
+ >
+ {stop.departTime || stop.arriveeTime}
+
+ )}
+
- {/* Column 3: Solid Snap Dot */}
+ {/* Column 3: Solid Snap Dot (Yellow #d2db24 uninterrupted, or primary if selected) */}
- {/* Column 4: Station name */}
-
{
- if (!isOrigin) setSelectedArrivalStops(prev => ({ ...prev, [item.id]: stop.gareNom }));
- }}
- className={`font-normal text-gray-900 ${!isOrigin ? 'cursor-pointer hover:underline' : ''} ${
- isSelected ? 'font-semibold text-gray-950' : ''
- }`}
- >
- {stop.gareNom}
-
+ {/* Column 4: Station name & status (strictly conforming to Image 1) */}
+
+ {stop.isSupprime ? (
+
+
+ {stop.gareNom}
+
+
+ !
+ Arrêt supprimé
+
+
+ {stop.perturbationDetails || "Accident à un passage à niveau"}
+
+
+ ) : stop.isNouveauTerminus ? (
+
+
{
+ if (!isOrigin) setSelectedArrivalStops(prev => ({ ...prev, [item.id]: stop.gareNom }));
+ }}
+ className={`font-normal text-gray-900 block leading-snug ${!isOrigin ? 'cursor-pointer hover:underline' : ''} ${isSelected ? 'font-semibold text-gray-950' : ''}`}
+ >
+ {stop.gareNom}
+
+
+ i
+ Terminus exceptionnel
+
+
+ ) : stop.isNouvelleOrigine ? (
+
+
+ {stop.gareNom}
+
+
+ i
+ Origine exceptionnelle
+
+
+ ) : stop.isAddedManually ? (
+
+
{
+ if (!isOrigin) setSelectedArrivalStops(prev => ({ ...prev, [item.id]: stop.gareNom }));
+ }}
+ className={`font-normal text-gray-900 block leading-snug ${!isOrigin ? 'cursor-pointer hover:underline' : ''} ${isSelected ? 'font-semibold text-gray-950' : ''}`}
+ >
+ {stop.gareNom}
+
+
+ +
+ Arrêt exceptionnel
+
+
+ ) : (
+
+ {
+ if (!isOrigin) setSelectedArrivalStops(prev => ({ ...prev, [item.id]: stop.gareNom }));
+ }}
+ className={`font-normal text-gray-900 block leading-snug ${!isOrigin ? 'cursor-pointer hover:underline' : ''} ${isSelected ? 'font-semibold text-gray-950' : ''}`}
+ >
+ {stop.gareNom}
+
+
+ )}
+
{/* Column 5: Voie */}
- {stop.voie}
+ {stop.isSupprime ? '-' : (stop.voie || '-')}
);
diff --git a/src/components/RegionContent.tsx b/src/components/RegionContent.tsx
index b294c26..f2570ad 100644
--- a/src/components/RegionContent.tsx
+++ b/src/components/RegionContent.tsx
@@ -622,7 +622,7 @@ export default function RegionContent({
.from('actualites')
.select('*')
.eq('actif', true)
- .in('region_id', regionCandidates)
+ .or(`region_id.is.null,region_id.in.(${regionCandidates.join(',')})`)
.is('deleted_at', null)
.order('date_publication', { ascending: false })
.order('created_at', { ascending: false });
@@ -635,7 +635,7 @@ export default function RegionContent({
.from('evenements')
.select('*')
.eq('actif', true)
- .in('region_id', regionCandidates)
+ .or(`region_id.is.null,region_id.in.(${regionCandidates.join(',')})`)
.is('deleted_at', null)
.order('date_debut', { ascending: false });
if (eData) {
diff --git a/src/components/SiteHeader.tsx b/src/components/SiteHeader.tsx
index 31b3f03..68e78d5 100644
--- a/src/components/SiteHeader.tsx
+++ b/src/components/SiteHeader.tsx
@@ -91,17 +91,6 @@ export default function SiteHeader({
)}
-
- {(brandPrimary || brandSecondary) && (
-