import React from 'react'; import { clsx } from 'clsx'; import { ArrowLeft, MoreVertical } from 'lucide-react'; import { Button, Breadcrumbs, DropdownMenu } from '@/components/ui'; import { useNavigate } from 'react-router-dom'; export interface PageHeaderAction { label: string; icon?: React.ReactNode; onClick: () => void; variant?: 'primary' | 'outline' | 'ghost' | 'destructive'; disabled?: boolean; } export interface PageHeaderProps { title: string; subtitle?: string; breadcrumbs?: Array<{ label: string; href?: string; icon?: React.ReactNode }>; actions?: PageHeaderAction[]; onBack?: () => void; backLabel?: string; className?: string; } /** * Enhanced page header component for admin pages */ export const PageHeader = ({ title, subtitle, breadcrumbs, actions = [], onBack, backLabel = 'Back', className, }: PageHeaderProps) => { const navigate = useNavigate(); const handleBack = () => { if (onBack) { onBack(); } else { navigate(-1); } }; const primaryActions = actions.filter((a) => a.variant === 'primary' || !a.variant); const secondaryActions = actions.filter((a) => a.variant !== 'primary' && a.variant !== 'destructive'); const destructiveActions = actions.filter((a) => a.variant === 'destructive'); const menuActions = [...secondaryActions, ...destructiveActions]; return (
{subtitle}
)}