"use client"; import { Button } from "@/components/shadcn/button/button"; import { Textarea } from "@/components/shadcn/textarea/textarea"; interface FeedbackFormReasonOption { value: TReason; label: string; } interface FeedbackFormReasons { label: string; options: readonly FeedbackFormReasonOption[]; selected: readonly TReason[]; onToggle: (reason: TReason) => void; } interface FeedbackFormProps { title: string; description?: string; reasons?: FeedbackFormReasons; detailsLabel: string; placeholder?: string; details: string; detailsMaxLength?: number; submitLabel?: string; isSubmitting?: boolean; submitDisabled?: boolean; error?: string | null; onDetailsChange: (details: string) => void; onSubmit: () => void; onCancel?: () => void; } export function FeedbackForm({ title, description, reasons, detailsLabel, placeholder, details, detailsMaxLength, submitLabel = "Submit", isSubmitting = false, submitDisabled = false, error, onDetailsChange, onSubmit, onCancel, }: FeedbackFormProps) { return (
{ event.preventDefault(); onSubmit(); }} >

{title}

{description ? (

{description}

) : null}
{reasons ? (
{reasons.label}
{reasons.options.map((reason) => { const selected = reasons.selected.includes(reason.value); return ( ); })}
) : null}