"use client"; import { RequiredHint } from "@suphark/ui/components/shared/form/required-hint"; import { FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, useFormField, } from "@suphark/ui/components/ui/form"; import type { Control, ControllerRenderProps, FieldValues, Path } from "react-hook-form"; import { RichTextEditor, type RichTextEditorProps } from "./rich-text-editor"; type EditorPassThrough = Pick< RichTextEditorProps, "className" | "variables" | "onSelectVariable" | "editorRef" | "placeholder" >; interface FormFieldRichTextProps extends EditorPassThrough { control: Control; name: Path; label: string; required?: boolean; description?: string; } function RichTextFieldBody({ field, label, required, description, ...editorProps }: EditorPassThrough & { field: ControllerRenderProps>; label: string; required?: boolean; description?: string; }) { const { formItemId } = useFormField(); const labelId = `${formItemId}-label`; return ( <> {/* contenteditable ไม่ใช่ช่องที่