import * as React from "react"; import { cx } from "@emotion/css"; import { modalCloseWrapper, modalContent, modalHeader } from "../style"; import ModalBase, { ModalBaseProps } from "./ModalBase"; import { display, flex, flexItem, padding, textSize } from "../../shared/styles/styleUtils"; import Clickable from "../../clickable/components/clickable"; import Icon, { IconProps } from "../../icon/components/Icon"; import { SystemIcons } from "../../icons/dist/system-icons-enum"; import { Flex, FlexItem } from "../../styleUtils/layout"; export interface DialogModalProps extends ModalBaseProps { /** Content that gets anchored to the button of the footer. Currently, this is just primary and secondary actions. ⚠️Do not use this directly⚠️ */ footerContent?: React.ReactNode; /** Whether we automatically add padding to the body of the modal. */ isContentFlush?: boolean; /** The text displayed in the header of the modal. */ title: React.ReactNode; /** Controls the icon displayed next to the title, here we can customize color, size, and shape. */ icon?: IconProps; } const DialogModal = (props: DialogModalProps) => { const { children, footerContent, isContentFlush, title, icon, ...other } = props; return (
{icon ? ( {title} ) : ( <>{title} )}
{children}
{footerContent && (
{footerContent}
)}
); }; export default React.memo(DialogModal);