← Files WixARCHIVED FILE

skills/wix-headless-templates/events/project/src/pages/events.astro

889 Bytes · Oct 8, 2026 · 12:02 UTC

↓ Download file

See the change to this file →

---
// Events listing — the first page fetched SERVER-SIDE (SEO) and handed to the island as DTO
// props; the island loads further pages and the category pills itself. Keep this frontmatter;
// swap the island import to YOUR listing component.
import SiteLayout from "../layouts/SiteLayout.astro";
import EventsView from "../components/events/EventsView";
import { fetchEventsPage } from "../wix/events/events";
import type { EventSummary } from "../wix/events/types";

let events: EventSummary[] = [];
let total = 0;
try {
  ({ events, total } = await fetchEventsPage());
} catch {
  // An unguarded SSR throw truncates the response mid-stream; the island renders the
  // empty state instead.
}
---

<SiteLayout title="Events">
  <h1 class="mb-8 text-2xl font-semibold tracking-tight">Events</h1>
  <EventsView client:load initialEvents={events} initialTotal={total} />
</SiteLayout>

SHA-256: 321f69748ae9eff4ce1d699cb45a1ae956fdd2f35ae87c787536a3653747fd2a