diff --git a/interface/src/project/DashboardDevicesDialog.tsx b/interface/src/project/DashboardDevicesDialog.tsx index a3bb48abd..25449b382 100644 --- a/interface/src/project/DashboardDevicesDialog.tsx +++ b/interface/src/project/DashboardDevicesDialog.tsx @@ -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 ( @@ -171,7 +160,7 @@ const DashboardDevicesDialog = ({ {writeable && ( - format: {showHelperText(editItem)} + {showHelperText(editItem)} )}