diff --git a/frontends/nextjs/src/components/molecules/Alert.tsx b/frontends/nextjs/src/components/molecules/Alert.tsx index 7b877c26c..3bc79ce49 100644 --- a/frontends/nextjs/src/components/molecules/Alert.tsx +++ b/frontends/nextjs/src/components/molecules/Alert.tsx @@ -7,16 +7,21 @@ import { AlertTitle as MuiAlertTitle, Collapse, IconButton, + SxProps, + Theme, } from '@mui/material' import CloseIcon from '@mui/icons-material/Close' export type AlertVariant = 'default' | 'destructive' | 'success' | 'warning' | 'info' -export interface AlertProps extends Omit { +export interface AlertProps { variant?: AlertVariant title?: ReactNode dismissible?: boolean onDismiss?: () => void + children?: ReactNode + className?: string + sx?: SxProps } const variantMap: Record = { @@ -28,7 +33,7 @@ const variantMap: Record = { } const Alert = forwardRef( - ({ variant = 'default', title, dismissible, onDismiss, children, ...props }, ref) => { + ({ variant = 'default', title, dismissible, onDismiss, children, className, sx, ...props }, ref) => { const severity = variantMap[variant] return ( @@ -36,6 +41,7 @@ const Alert = forwardRef( ref={ref} severity={severity} variant="outlined" + className={className} action={ dismissible && onDismiss ? ( ( ) : undefined } - sx={{ borderRadius: 1 }} - {...props} + sx={{ borderRadius: 1, ...sx }} > {title && {title}} {children}