All checks were successful
Build and Deploy / Build & Push (push) Successful in 2m22s
Parks in the 1-hour buffer after scheduled close now show amber instead of green: the dot on the desktop calendar turns yellow, and the mobile card badge changes from "Open today" (green) to "Closing" (amber). - getOperatingStatus() replaces isWithinOperatingWindow's inline logic, returning "open" | "closing" | "closed"; isWithinOperatingWindow now delegates to it so all callers are unchanged - closingParkIds[] is computed server-side and threaded through HomePageClient → WeekCalendar/MobileCardList → ParkRow/ParkCard - New --color-closing-* CSS variables mirror the green palette in amber Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
67 lines
2.0 KiB
TypeScript
67 lines
2.0 KiB
TypeScript
import type { Park } from "@/lib/scrapers/types";
|
|
import type { DayData } from "@/lib/db";
|
|
import type { Region } from "@/lib/parks";
|
|
import { ParkCard } from "./ParkCard";
|
|
|
|
interface MobileCardListProps {
|
|
grouped: Map<Region, Park[]>;
|
|
weekDates: string[];
|
|
data: Record<string, Record<string, DayData>>;
|
|
today: string;
|
|
rideCounts?: Record<string, number>;
|
|
coastersOnly?: boolean;
|
|
closingParkIds?: string[];
|
|
}
|
|
|
|
export function MobileCardList({ grouped, weekDates, data, today, rideCounts, coastersOnly, closingParkIds }: MobileCardListProps) {
|
|
return (
|
|
<div style={{ display: "flex", flexDirection: "column", gap: 20, paddingTop: 14 }}>
|
|
{Array.from(grouped.entries()).map(([region, parks]) => (
|
|
<div key={region} data-region={region}>
|
|
{/* Region heading */}
|
|
<div style={{
|
|
display: "flex",
|
|
alignItems: "center",
|
|
gap: 10,
|
|
marginBottom: 10,
|
|
paddingLeft: 2,
|
|
}}>
|
|
<div style={{
|
|
width: 3,
|
|
height: 14,
|
|
borderRadius: 2,
|
|
background: "var(--color-region-accent)",
|
|
flexShrink: 0,
|
|
}} />
|
|
<span style={{
|
|
fontSize: "0.65rem",
|
|
fontWeight: 700,
|
|
letterSpacing: "0.1em",
|
|
textTransform: "uppercase",
|
|
color: "var(--color-text-muted)",
|
|
}}>
|
|
{region}
|
|
</span>
|
|
</div>
|
|
|
|
{/* Park cards */}
|
|
<div style={{ display: "flex", flexDirection: "column", gap: 8 }}>
|
|
{parks.map((park) => (
|
|
<ParkCard
|
|
key={park.id}
|
|
park={park}
|
|
weekDates={weekDates}
|
|
parkData={data[park.id] ?? {}}
|
|
today={today}
|
|
openRideCount={rideCounts?.[park.id]}
|
|
coastersOnly={coastersOnly}
|
|
isClosing={closingParkIds?.includes(park.id)}
|
|
/>
|
|
))}
|
|
</div>
|
|
</div>
|
|
))}
|
|
</div>
|
|
);
|
|
}
|