import { memo } from "preact/compat"; import { twMerge } from "tailwind-merge"; import Cancel from "../icons/Cancel"; import IconButton from "../ui/IconButton"; import type { HTMLAttributes, PreactDOMAttributes } from "preact"; export type OverlayHeaderProps = { onClose?: () => void; title?: React.ReactNode; } & HTMLAttributes & PreactDOMAttributes; function OverlayHeader({ children, className, onClose, title, ...props }: OverlayHeaderProps) { return (
{/* We set text-base so the clamp works on overlay container, not main */} {children || {title}} {onClose && ( )}
); } export default memo(OverlayHeader);