Skip to content

Commit

Permalink
fix(alternator): display CustomName when available
Browse files Browse the repository at this point in the history
  • Loading branch information
mman committed Aug 29, 2024
1 parent 7707934 commit c95de7c
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ interface Props {
}

const EnergyAlternator = ({ componentMode = "compact", alternator, showInstance, compactBoxSize }: Props) => {
const { current, voltage } = useAlternator(alternator)
const { current, voltage, customName } = useAlternator(alternator)
const instance = showInstance ? ` [${alternator}]` : ""
const power = current * voltage

if (componentMode === "compact" && compactBoxSize) {
return (
<ValueOverview
Icon={AlternatorIcon}
title={translate("boxes.alternator")}
title={customName || translate("boxes.alternator")}
value={current}
unit="A"
boxSize={compactBoxSize}
Expand All @@ -33,7 +33,7 @@ const EnergyAlternator = ({ componentMode = "compact", alternator, showInstance,

return (
<ValueBox
title={translate("boxes.alternator") + instance}
title={customName || translate("boxes.alternator") + instance}
icon={<AlternatorIcon className={responsiveBoxIcon} />}
value={current}
unit="A"
Expand Down

0 comments on commit c95de7c

Please sign in to comment.