import { CloseIcon, InformationFillDuotoneIcon } from '@blocksuite/icons/rc'; import { assignInlineVars } from '@vanilla-extract/dynamic'; import clsx from 'clsx'; import { type HTMLAttributes, useCallback } from 'react'; import { Button, IconButton } from '../button'; import * as styles from './styles.css'; import type { Notification } from './types'; import { getActionTextColor, getCardBorderColor, getCardColor, getCardForegroundColor, getCloseIconColor, getIconColor, } from './utils'; export interface NotificationCardProps extends HTMLAttributes { notification: Notification; } export const NotificationCard = ({ notification }: NotificationCardProps) => { const { theme = 'info', style = 'normal', icon = , iconColor, thumb, action, title, footer, alignMessage = 'title', onDismiss, rootAttrs, } = notification; const onActionClicked = useCallback(() => { action?.onClick()?.catch(console.error); if (action?.autoClose !== false) { onDismiss?.(); } }, [action, onDismiss]); return (
{thumb}
{icon ? (
{icon}
) : null}
{title}
{action ? (
) : null}
{notification.message}
); };