import { Editor, Row } from '@components/common/form/Editor.js'; import { InputField } from '@components/common/form/InputField.js'; import React from 'react'; import { useFormContext } from 'react-hook-form'; interface TextBlockSettingProps { textWidget: { text: Row[]; className: string; }; } export default function TextBlockSetting({ textWidget: { text, className } }: TextBlockSettingProps) { const { register, watch, setValue } = useFormContext(); const editorValue = watch('temp_editor_text'); React.useEffect(() => { if (editorValue) { setValue('settings.text', JSON.stringify(editorValue)); } }, [editorValue, setValue]); return (
); } export const query = ` query Query($text: String, $className: String) { textWidget(text: $text, className: $className) { text className } } `; export const variables = `{ text: getWidgetSetting("text"), className: getWidgetSetting("className") }`;