2026-05-19 12:55:08 +02:00
|
|
|
import React from 'react'
|
2026-05-19 11:18:54 +02:00
|
|
|
import { useFormEditorActions } from '../context/FormEditorActionsContext'
|
2026-05-20 07:42:46 +02:00
|
|
|
import PageReturnButton from './PageReturnButton'
|
2026-05-19 11:18:54 +02:00
|
|
|
|
|
|
|
|
/**
|
2026-05-20 07:56:22 +02:00
|
|
|
* Vollseiten-Editor: optional Zurück oben; FormActionBar fix unten (FormEditorBottomSlot).
|
|
|
|
|
* Mit actionConfig ist showReturn standardmäßig aus — Rücksprung über Abbrechen / Speichern & Schließen.
|
2026-05-19 11:18:54 +02:00
|
|
|
*/
|
|
|
|
|
export default function PageFormEditorChrome({
|
|
|
|
|
title,
|
2026-05-20 07:42:46 +02:00
|
|
|
fallbackPath,
|
|
|
|
|
fallbackLabel,
|
2026-05-19 11:18:54 +02:00
|
|
|
actionConfig,
|
|
|
|
|
children,
|
|
|
|
|
testId,
|
2026-05-20 07:56:22 +02:00
|
|
|
showReturn = false,
|
2026-05-19 11:18:54 +02:00
|
|
|
}) {
|
|
|
|
|
useFormEditorActions(actionConfig)
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div className="page-form-editor" data-testid={testId}>
|
|
|
|
|
<header className="page-form-editor__header">
|
2026-05-20 07:42:46 +02:00
|
|
|
{showReturn && fallbackPath && fallbackLabel ? (
|
|
|
|
|
<PageReturnButton
|
|
|
|
|
fallbackPath={fallbackPath}
|
|
|
|
|
fallbackLabel={fallbackLabel}
|
|
|
|
|
className="page-return-btn page-form-editor__back btn btn-secondary btn-small"
|
|
|
|
|
/>
|
2026-05-19 11:18:54 +02:00
|
|
|
) : null}
|
2026-05-19 12:55:08 +02:00
|
|
|
<h1 className="page-form-editor__title">{title}</h1>
|
2026-05-19 11:18:54 +02:00
|
|
|
</header>
|
|
|
|
|
<div className="page-form-editor__body">{children}</div>
|
|
|
|
|
</div>
|
|
|
|
|
)
|
|
|
|
|
}
|