'use client' import { Button } from '@heroui/react' import type { EventAgeRestriction, EventGenderRestriction } from '@/lib/eventAudience' import { AGE_RESTRICTION_OPTIONS, GENDER_RESTRICTION_OPTIONS } from '@/lib/eventAudience' import { cn } from '@/lib/cn' import { texts } from '@/texts' interface AudienceRestrictionSelectorProps { ageRestriction: EventAgeRestriction genderRestriction: EventGenderRestriction disabled?: boolean onAgeRestrictionChange: (value: EventAgeRestriction) => void onGenderRestrictionChange: (value: EventGenderRestriction) => void } /** Content-width button groups for age and gender limits shown to event guests. */ export default function AudienceRestrictionSelector({ ageRestriction, genderRestriction, disabled = false, onAgeRestrictionChange, onGenderRestrictionChange, }: AudienceRestrictionSelectorProps) { return (
{ onGenderRestrictionChange(value as EventGenderRestriction) }} /> { onAgeRestrictionChange(value as EventAgeRestriction) }} />
) } function RestrictionGroup({ ariaLabel, disabled = false, options, value, onChange, }: { ariaLabel: string disabled?: boolean options: readonly { name: string; selectKey: string }[] value: string onChange: (value: string) => void }) { return (
{options.map((option) => { const active = option.selectKey === value return ( ) })}
) }