import { Check, InfoOutlined, WarningRounded } from '@mui/icons-material' import clsx from 'clsx' import { ReactNode } from 'react' import { Loader } from './logo' export type StatusCardProps = { style: 'info' | 'loading' | 'success' | 'warning' size?: 'xs' | 'sm' | 'default' content?: ReactNode children?: ReactNode className?: string iconClassName?: string textClassName?: string contentContainerClassName?: string /** * If true, the icon will be placed at the top of the card. Otherwise, it will * be centered vertically. */ iconAtTop?: boolean onClick?: () => void } export const StatusCard = ({ style, size = 'default', content, children, className, iconClassName, textClassName, contentContainerClassName, iconAtTop = false, onClick, }: StatusCardProps) => { const Icon = style === 'info' ? InfoOutlined : style === 'success' ? Check : style === 'warning' ? WarningRounded : undefined const iconColor = style === 'info' ? 'text-icon-secondary' : style === 'warning' ? 'text-icon-interactive-warning' : undefined const textColor = style === 'warning' ? '!text-text-interactive-warning-body' : undefined return (
{content}
) : ( content )} {children}