import type { PropsWithChildren, RefAttributes } from "react"; import { useEffect, useId } from "react"; import { cross } from "@simplybusiness/icons"; import type { DOMProps } from "../../types/dom"; import { Button } from "../Button"; import { Icon } from "../Icon"; import { useModal } from "./useModal"; export type HeaderElementType = HTMLDivElement; export interface HeaderProps extends DOMProps, RefAttributes, PropsWithChildren {} const Header = ({ ref, children, ...otherProps }: HeaderProps) => { const { onClose, closeLabel, setTitleId } = useModal(); const titleId = useId(); useEffect(() => { setTitleId(titleId); }, [titleId, setTitleId]); return (
{children}
); }; Header.displayName = "Header"; export { Header };