import * as styles from './styles.css' import { IconSolidExclamation, IconSolidInformationCircle, IconSolidX, IconSolidXCircle, } from '../icons' import { Box } from '../Box/Box' import { ButtonIcon } from '../ButtonIcon/ButtonIcon' import React from 'react' import { Text } from '../Text/Text' import { vars } from '../../css/vars' export type Props = React.PropsWithChildren & styles.Variants & { title?: string width?: number style?: React.CSSProperties handleCloseClick?: () => void icon?: false | (() => JSX.Element) } export const Callout: React.FC = ({ children, kind = 'info', title, icon, border, style = {}, width, handleCloseClick, }) => { const Icon = icon || kindIconLookup[kind] return ( {icon !== false ? : null} {title && ( {title} {handleCloseClick && ( } onClick={handleCloseClick} /> )} )} {children} ) } // These are temporary until we componentize icon badges. const InfoIcon = () => ( ) const WarningIcon = () => ( ) const ErrorIcon = () => ( ) const kindIconLookup = { error: ErrorIcon, info: InfoIcon, warning: WarningIcon, } as const