Skip to main content

EventsList

packages/leisure/components/organisms/EventsList.js · Tier: organism · Module: leisure · Rendering: Server Component (async)

Purpose​

Fetches one page of events from the leisure microservice and renders the card grid (with an optional staff "create" card), pagination, and the fetch-error / empty states. Designed to be wrapped in <Suspense> so the filter controls render immediately.

Props​

PropTypeRequiredDefaultDescription
langstringyes—Locale.
pagenumberyes—Zero-based page index.
eventTypestring | nullyes—Type filter.
paidboolean | nullyes—Paid filter.
accessTokenstring | undefinedyes—Bearer token for the fetch.
canManagebooleanyes—Shows the staff "create event" card.
tobjectyes—leisure.events dictionary.
pageHref(pageNumber) => stringyes—Pager href builder.

Behaviour​

await getEvents({ page, eventType, paid }, accessToken); renders FetchErrorBanner on failure and an empty state otherwise. Prices are formatted via formatPrice; dates via formatEventDateTime.

Composition​

  • Uses: molecules/core/CatalogueCard, molecules/core/FetchErrorBanner, molecules/core/SectionPager, molecules/leisure/CreateCard, atoms/core/Icon, getEvents + format utils (leisure/lib).
  • Used by: the events list page.

Internationalisation​

All copy from the leisure.events dictionary.

Accessibility​

<section aria-labelledby> with an <h2>; empty/error states are clearly labelled.

organisms/leisure/EventFilters, organisms/leisure/EventDetailView, molecules/core/CatalogueCard.