mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 00:09:51 +03:00
message optional in MessageBox
This commit is contained in:
@@ -264,7 +264,7 @@ const Dashboard = () => {
|
|||||||
</Box>
|
</Box>
|
||||||
|
|
||||||
{!loading && !hasFavEntities && (
|
{!loading && !hasFavEntities && (
|
||||||
<MessageBox my={1} level="info" message="">
|
<MessageBox my={1} level="info">
|
||||||
<Typography>
|
<Typography>
|
||||||
{LL.NO_DATA_1()}
|
{LL.NO_DATA_1()}
|
||||||
<Link to="/customizations" style={{ color: 'white' }}>
|
<Link to="/customizations" style={{ color: 'white' }}>
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ type MessageBoxLevel = 'warning' | 'success' | 'info' | 'error';
|
|||||||
|
|
||||||
export interface MessageBoxProps extends BoxProps {
|
export interface MessageBoxProps extends BoxProps {
|
||||||
level: MessageBoxLevel;
|
level: MessageBoxLevel;
|
||||||
message: string;
|
message?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const LEVEL_ICONS: {
|
const LEVEL_ICONS: {
|
||||||
@@ -53,8 +53,8 @@ const MessageBox: FC<MessageBoxProps> = ({
|
|||||||
{...rest}
|
{...rest}
|
||||||
>
|
>
|
||||||
<Icon />
|
<Icon />
|
||||||
<Typography sx={{ ml: 2, flexGrow: 1 }} variant="body1">
|
<Typography sx={{ ml: 2 }} variant="body1">
|
||||||
{message}
|
{message ?? ''}
|
||||||
</Typography>
|
</Typography>
|
||||||
{children}
|
{children}
|
||||||
</Box>
|
</Box>
|
||||||
|
|||||||
@@ -4608,7 +4608,6 @@ router
|
|||||||
t: DeviceType.CUSTOM,
|
t: DeviceType.CUSTOM,
|
||||||
nodes: getDashboardEntityData(DeviceTypeUniqueID.CUSTOM_UID)
|
nodes: getDashboardEntityData(DeviceTypeUniqueID.CUSTOM_UID)
|
||||||
};
|
};
|
||||||
// only add to dashboard if we have values
|
|
||||||
if ((dashboard_object.nodes ?? []).length > 0) {
|
if ((dashboard_object.nodes ?? []).length > 0) {
|
||||||
dashboard_data.push(dashboard_object);
|
dashboard_data.push(dashboard_object);
|
||||||
}
|
}
|
||||||
@@ -4629,8 +4628,6 @@ router
|
|||||||
// t: DeviceType.SCHEDULER,
|
// t: DeviceType.SCHEDULER,
|
||||||
// nodes: scheduler_data2
|
// nodes: scheduler_data2
|
||||||
// };
|
// };
|
||||||
|
|
||||||
// only add to dashboard if we have values
|
|
||||||
// if ((dashboard_object.nodes ?? []).length > 0) {
|
// if ((dashboard_object.nodes ?? []).length > 0) {
|
||||||
// dashboard_data.push(dashboard_object);
|
// dashboard_data.push(dashboard_object);
|
||||||
// }
|
// }
|
||||||
|
|||||||
Reference in New Issue
Block a user