message optional in MessageBox

This commit is contained in:
proddy
2025-01-14 22:09:23 +01:00
parent 570678e3d3
commit b23bcf3f0b
3 changed files with 14 additions and 17 deletions

View File

@@ -264,7 +264,7 @@ const Dashboard = () => {
</Box>
{!loading && !hasFavEntities && (
<MessageBox my={1} level="info" message="">
<MessageBox my={1} level="info">
<Typography>
{LL.NO_DATA_1()}&nbsp;
<Link to="/customizations" style={{ color: 'white' }}>

View File

@@ -11,7 +11,7 @@ type MessageBoxLevel = 'warning' | 'success' | 'info' | 'error';
export interface MessageBoxProps extends BoxProps {
level: MessageBoxLevel;
message: string;
message?: string;
}
const LEVEL_ICONS: {
@@ -53,8 +53,8 @@ const MessageBox: FC<MessageBoxProps> = ({
{...rest}
>
<Icon />
<Typography sx={{ ml: 2, flexGrow: 1 }} variant="body1">
{message}
<Typography sx={{ ml: 2 }} variant="body1">
{message ?? ''}
</Typography>
{children}
</Box>