/** * CollapsibleCardHeader * * Shared header row with a title + chevron toggle, optional children after title/chevron, * and an optional right section for action buttons. */ import React from 'react'; import { ChevronDown, ChevronUp } from 'lucide-react'; import { CardHeader, CardTitle } from './card'; import { cn } from '../../lib/utils'; interface CollapsibleCardHeaderProps { title: React.ReactNode; isCollapsed: boolean; onToggle: () => void; children?: React.ReactNode; rightSection?: React.ReactNode; className?: string; titleClassName?: string; toggleLabel?: string; } const CollapsibleCardHeader: React.FC = ({ title, isCollapsed, onToggle, children, rightSection, className, titleClassName, toggleLabel }) => { const accessibilityProps = toggleLabel ? { title: toggleLabel, 'aria-label': toggleLabel } : {}; return (
{children &&
{children}
}
{rightSection &&
{rightSection}
}
); }; export default CollapsibleCardHeader;