import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogTrigger } from '@/components/ui/dialog'; import { useLang } from '@/hooks/use-lang'; import { ReactNode } from 'react'; import { SectionEditorProvider, useSectionEditor } from './context'; import EditorForm from './form'; interface Props { section: PageSection; actionComponent: ReactNode; } const SectionEditor = ({ section, actionComponent }: Props) => { return ( ); }; // Separate component to use the context const SectionEditorContent = ({ actionComponent }: { actionComponent: ReactNode }) => { const { button, frontend } = useLang(); const { open, setOpen, isSubmit, section } = useSectionEditor(); return ( !isSubmit && setOpen(value)}> {actionComponent} {button.update} {section.name} {frontend.section} ); }; export default SectionEditor;