From f3bb7b7b0ca68bda731a4245ade4f84de87ed1b3 Mon Sep 17 00:00:00 2001 From: JohnDoe6345789 Date: Thu, 25 Dec 2025 19:56:15 +0000 Subject: [PATCH] code: tsx,nextjs,frontends (1 files) --- frontends/nextjs/src/components/molecules/Alert.tsx | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) 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}