Skip to main content

EventForm

packages/leisure/components/organisms/EventForm.js · Tier: organism · Module: leisure · Rendering: Client Component ('use client')

Purpose​

The shared form to create (POST) or fully update (PUT) a leisure event. It receives the catalogue of available city places so the user can bind the event to one (events are always anchored to an existing place). Text fields are multilingual.

Props​

PropTypeRequiredDefaultDescription
mode'create' | 'edit'yes—Create or update.
eventobjectno—Existing event (edit mode).
placesArray<{ id, name }>yes—Catalogue of places to anchor the event to.
tobjectyes—leisure.eventForm dictionary.
typeLabelsRecord<string,string>yes—leisure.eventTypes labels.
langstringyes—Locale.

Behaviour​

Initialises multilingual { es, en, fr } name/description from event.translations; maps the form to the create/update event actions; navigation back uses useLocalizedBack.

Composition​

  • Uses: MultilingualFields, atoms/core/FormField, atoms/core/Button, atoms/core/Icon, the event server actions, useLocalizedBack.
  • Used by: the create/edit event routes.

Internationalisation​

Translatable fields via MultilingualFields with AI translate; type labels via typeLabels.

Accessibility​

Fields via FormField; the place binding is a labelled select.

molecules/core/MultilingualFields, organisms/leisure/EventDetailView.