import { EditableFieldTextArea } from '@components/EditableField'; import { getContentNodeByKeyPath } from '@intlayer/core/dictionaryManipulator'; import { useEditorLocale } from '@intlayer/editor-react'; import { cn } from '@utils/cn'; import type { FC } from 'react'; import type { NodeWrapperProps } from './index'; export type StringWrapperProps = Omit & { section: string; editedContentValue?: string; }; export const StringWrapper: FC = ({ keyPath, section, editedContent, editedContentValue: editedContentValueProp, onContentChange, onFocusKeyPath, renderSection, }) => { const currentLocale = useEditorLocale(); const editedContentValue = editedContentValueProp ?? getContentNodeByKeyPath(editedContent, keyPath, currentLocale); if (editedContentValue && typeof editedContentValue !== 'string') { return ( <> Error loading section - Edited content Incoherence with the original content format ); } const level = keyPath.length; const content = String(editedContentValue ?? section); return ( ); };