added SodistoreHome Battery View Soc and Voltage Color code in frontend

This commit is contained in:
Yinyin Liu 2025-11-17 13:13:25 +01:00
parent 58bd0611a3
commit 71e2644866
1 changed files with 12 additions and 5 deletions

View File

@ -271,12 +271,14 @@ function BatteryViewSodioHome(props: BatteryViewSodioHomeProps) {
sx={{
width: '13%',
textAlign: 'center',
backgroundColor: '#32CD32',
color: 'black'
backgroundColor:
battery.Voltage < 32 || battery.Voltage > 63
? '#FF033E'
: '#32CD32',
color: 'inherit'
}}
>
{battery.Voltage + ' ' + 'V'}
{battery.Voltage + ' V'}
</TableCell>
<TableCell
sx={{
@ -292,7 +294,12 @@ function BatteryViewSodioHome(props: BatteryViewSodioHomeProps) {
sx={{
width: '8%',
textAlign: 'center',
backgroundColor: '#32CD32',
backgroundColor:
battery.Soc > 20
? '#32CD32'
: battery.Soc >= 10
? '#ffbf00'
: '#FF033E',
color: 'inherit'
}}
>