feat: hide parks with no open days in the current week
Some checks failed
Build and Deploy / Build & Push (push) Has been cancelled
Some checks failed
Build and Deploy / Build & Push (push) Has been cancelled
Header subtitle now shows "X of 24 parks open" for context. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -45,6 +45,11 @@ export default async function HomePage({ searchParams }: PageProps) {
|
||||
0
|
||||
);
|
||||
|
||||
// Only show parks that have at least one open day this week
|
||||
const visibleParks = PARKS.filter((park) =>
|
||||
weekDates.some((date) => data[park.id]?.[date]?.isOpen)
|
||||
);
|
||||
|
||||
return (
|
||||
<div style={{ minHeight: "100vh", background: "var(--color-bg)" }}>
|
||||
{/* Header */}
|
||||
@@ -65,7 +70,7 @@ export default async function HomePage({ searchParams }: PageProps) {
|
||||
Six Flags Calendar
|
||||
</span>
|
||||
<span style={{ fontSize: "0.75rem", color: "var(--color-text-muted)" }}>
|
||||
{PARKS.length} parks
|
||||
{visibleParks.length} of {PARKS.length} parks open
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -79,7 +84,7 @@ export default async function HomePage({ searchParams }: PageProps) {
|
||||
{scrapedCount === 0 ? (
|
||||
<EmptyState />
|
||||
) : (
|
||||
<WeekCalendar parks={PARKS} weekDates={weekDates} data={data} />
|
||||
<WeekCalendar parks={visibleParks} weekDates={weekDates} data={data} />
|
||||
)}
|
||||
</main>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user