/* * @Author: ZhaoYing * @Date: 2026-02-10 11:08:27 * @Last Modified by: ZhaoYing * @Last Modified time: 2026-03-26 15:38:31 */ /* * PageHeader Component * * A reusable page header component that provides a consistent layout for page titles, * subtitles, and action buttons across the application. * * Features: * - Displays a main title and optional subtitle * - Supports custom action buttons or extra content on the right side * - Fixed height (64px) with responsive layout * - Text overflow handling with ellipsis * - Consistent spacing and styling using Tailwind CSS */ import { type FC, type ReactNode } from 'react'; import { Layout, Flex } from 'antd'; import clsx from 'clsx'; const { Header } = Layout; interface ConfigHeaderProps { avatarUrl?: string | null; avatarText?: string; avatarClassName?: string; title?: ReactNode | string; operation?: ReactNode; extra?: ReactNode; centerContent?: ReactNode; } const PageHeader: FC = ({ avatarUrl, avatarText, avatarClassName, title, operation, extra, centerContent }) => { return ( // Main header container: full width, 64px height, flex layout with space between
{avatarUrl ? {avatarUrl} : avatarText ? {avatarText} : null } {/* Left section: Title and subtitle */}
{/* Main title: 18px font, semibold, [#212332] color, single line with ellipsis */}
{title}
{operation}
{centerContent && {centerContent} } {/* Right section: Extra content (buttons, filters, etc.) */} {extra}
); }; export default PageHeader;