/** * Feste Aktionsleiste für Formulare/Modale: Speichern, Speichern & schließen, Abbrechen. * Bleibt sichtbar (sticky), während der Formularinhalt scrollt. */ export default function FormActionBar({ placement = 'bottom', variant = 'default', saving = false, saveLabel, saveAndCloseLabel = 'Speichern & schließen', cancelLabel = 'Abbrechen', onSave, onSaveAndClose, onCancel, showSave = true, showSaveAndClose = true, showCancel = true, formId, isNew = false, primaryIsSaveOnly = false, }) { const labelSave = saveLabel ?? (isNew ? 'Anlegen' : 'Speichern') const showSaveBtn = showSave && (Boolean(onSave) || Boolean(formId)) const showCloseBtn = showSaveAndClose && (Boolean(onSaveAndClose) || Boolean(formId)) const showCancelBtn = showCancel && Boolean(onCancel) if (!showSaveBtn && !showCloseBtn && !showCancelBtn) return null const saveBtnClass = `btn form-action-bar__btn${ primaryIsSaveOnly ? ' btn-primary' : ' btn-secondary' }` const closeBtnClass = `btn form-action-bar__btn${ primaryIsSaveOnly ? ' btn-secondary' : ' btn-primary' }` return (