import React, { forwardRef } from "react"; import { XMarkIcon } from "@navikt/aksel-icons"; import { Button } from "../../button"; import { cl } from "../../utils/helpers"; import { useI18n } from "../../utils/i18n/i18n.hooks"; import { DialogCloseTrigger } from "../close-trigger/DialogCloseTrigger"; interface DialogHeaderProps extends React.HTMLAttributes { /** * Whether to show a close button in the header. * Will trigger `onOpenChange` when clicked. * @default true */ withClosebutton?: boolean; } /** * @see 🏷️ {@link DialogHeaderProps} * @example * ```jsx * * * * Dialog title * * * * ``` */ const DialogHeader = forwardRef( ( { className, children, withClosebutton = true, ...restProps }, forwardedRef, ) => { const translate = useI18n("global"); return (
{withClosebutton && (
); }, ); export { DialogHeader }; export type { DialogHeaderProps };