mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 07:49:52 +03:00
fix formatting for ranges not showing
This commit is contained in:
@@ -89,27 +89,16 @@ const DashboardDevicesDialog = ({
|
||||
}
|
||||
};
|
||||
|
||||
const showHelperText = (dv: DeviceValue) => {
|
||||
if (dv.h) {
|
||||
return dv.h;
|
||||
}
|
||||
if (dv.l) {
|
||||
return '[ ' + dv.l.join(' | ') + ' ]';
|
||||
}
|
||||
|
||||
let helperText = '<';
|
||||
if (dv.s) {
|
||||
helperText += 'n';
|
||||
if (dv.m !== undefined && dv.x !== undefined) {
|
||||
helperText += ' between ' + dv.m + ' and ' + dv.x;
|
||||
} else {
|
||||
helperText += ' , step ' + dv.s;
|
||||
}
|
||||
} else {
|
||||
helperText += 'text';
|
||||
}
|
||||
return helperText + '>';
|
||||
};
|
||||
const showHelperText = (dv: DeviceValue) =>
|
||||
dv.h ? (
|
||||
dv.h
|
||||
) : dv.l ? (
|
||||
dv.l.join(' | ')
|
||||
) : dv.m !== undefined && dv.x !== undefined ? (
|
||||
<>
|
||||
{dv.m} → {dv.x}
|
||||
</>
|
||||
) : undefined;
|
||||
|
||||
return (
|
||||
<Dialog sx={dialogStyle} open={open} onClose={close}>
|
||||
@@ -171,7 +160,7 @@ const DashboardDevicesDialog = ({
|
||||
</Grid>
|
||||
{writeable && (
|
||||
<Grid item>
|
||||
<FormHelperText>format: {showHelperText(editItem)}</FormHelperText>
|
||||
<FormHelperText>{showHelperText(editItem)}</FormHelperText>
|
||||
</Grid>
|
||||
)}
|
||||
</Grid>
|
||||
|
||||
Reference in New Issue
Block a user