'use client' import Input from '@/components/formElements/Input' import { texts } from '@/texts' interface CancellationPolicyEditorProps { disabled?: boolean value: number onChange: (value: number) => void } /** * Makes the cancellation fee explicit to hosts while keeping the persisted * event contract to the existing `cancellationFeePercent` field. */ export default function CancellationPolicyEditor({ disabled = false, value, onChange }: CancellationPolicyEditorProps) { const normalizedValue = Number.isFinite(value) ? Math.min(100, Math.max(0, value)) : 0 return (

{texts.events.cancellationFeeLabel}

{texts.events.cancellationSectionDescription}

{ const next = Number(nextValue) onChange(Number.isFinite(next) ? Math.min(100, Math.max(0, next)) : 0) }} /> {/* This marker belongs to the compact numeric field, not to its value. */} ٪
) }