This commit is contained in:
sctanf
2025-12-13 21:02:30 -06:00
parent 122efacc52
commit cf357e71f5

View File

@@ -15,7 +15,7 @@ export function TrackerBattery({
*/
value: number;
voltage?: number | null;
runtime?: BigInt | null
runtime?: bigint | null;
disabled?: boolean;
textColor?: string;
}) {
@@ -35,24 +35,19 @@ export function TrackerBattery({
return (
<div className="flex gap-2">
<div className="flex flex-col justify-around">
<BatteryIcon value={value} disabled={disabled} charging={charging}/>
<BatteryIcon value={value} disabled={disabled} charging={charging} />
</div>
{((!charging || showVoltage) && (
<div className="w-15">
{!charging && runtime && (
<Typography color={textColor}>
{((
runtime.valueOf() /
BigInt(3600000000)
).toString() +
'h ' +
(
(runtime.valueOf() %
BigInt(3600000000)) /
BigInt(60000000)
).toString() +
'min') ||
'N/A'}
{(runtime.valueOf() / BigInt(3600000000)).toString() +
'h ' +
(
(runtime.valueOf() % BigInt(3600000000)) /
BigInt(60000000)
).toString() +
'min' || 'N/A'}
</Typography>
)}
{!charging && (!runtime || showVoltage) && (