import type { ReactNode } from 'react' import { colors } from '../tokens' interface PageWrapperProps { title: string description?: string extra?: ReactNode children: ReactNode /** * 内联模式:title + 竖线 + description 横排,right-align extra。 * 搭配 fullHeight 使用,是全高页面的标准页头样式。 */ inline?: boolean /** * 撑满父容器高度:header 固定,children 填充剩余空间。 * 适用于所有管理页面。 */ fullHeight?: boolean } export default function PageWrapper({ title, description, extra, children, inline, fullHeight, }: PageWrapperProps) { // Inline mode: horizontal header with padding (used with fullHeight) if (inline) { return (

{title}

{description && ( <> {description} )} {extra &&
{extra}
}
{fullHeight ?
{children}
: children}
) } // Block mode: stacked header with marginBottom (legacy, scrollable pages) const header = (

{title}

{description && (

{description}

)}
{extra &&
{extra}
}
) if (fullHeight) { return (
{header}
{children}
) } return
{header}{children}
}