/** * EditorHeader * * Shared header used by editor pages (Content, Content Type, Section, * Settings) for consistent placement of a back-link / title / actions row. * * Renders as a normal block at the top of the page. The previous sticky * variant had transparency/z-index/layout bugs and added permanent visual * chrome; we now rely on each editor rendering an additional Save button * at the natural end of the form (DOM order matches logical order, so * keyboard / screen-reader users hit a save control as the last * interactive element) instead. * * RTL: * The component itself uses only symmetric horizontal utilities * (`flex`, `gap-*`), so it's direction-agnostic. Callers passing * directional content into `leading` / `actions` slots should use * logical classes (`ms-*`, `me-*`, `start-*`, `end-*`) for any * side-specific spacing. */ import * as React from "react"; import { cn } from "../lib/utils"; export interface EditorHeaderProps { /** Optional leading element, typically a back-link or close button. */ leading?: React.ReactNode; /** Header title content. Pass a heading element so semantics are correct. */ children: React.ReactNode; /** Right-aligned action area (Save, Publish, etc.). */ actions?: React.ReactNode; className?: string; } /** * Editor header with consistent placement of save / primary actions. * * Usage: * * } * actions={} * > *

{title}

*
*/ export function EditorHeader({ leading, children, actions, className }: EditorHeaderProps) { return (
{leading}
{children}
{actions &&
{actions}
}
); } export default EditorHeader;