Skip to content

Commit

Permalink
Added todo
Browse files Browse the repository at this point in the history
  • Loading branch information
fwaalkens committed Sep 19, 2023
1 parent 4a71ef5 commit f3be72d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import React, { useState } from "react"
import classNames from "classnames"
import Box from "../../ui/Box"
import DevicesIcon from "../../../images/icons/devices.svg"
import { AppViews } from "../../../modules/AppViews"
Expand All @@ -24,10 +26,8 @@ import { useVisibilityNotifier } from "../../../modules"
import { AC_SOURCE, BoxTypes, RELAY_FUNCTION } from "../../../utils/constants"
import { PageSelectorProps } from "../../ui/PageSelector"
import GridPaginator from "../../ui/GridPaginator"
import React from "react"
import GeneratorRelay from "../GeneratorRelay/GeneratorRelay"
import { applyStyles, defaultBoxStyles } from "../../../utils/media"
import classNames from "classnames"
import { ComponentMode } from "@m2Types/generic/component-mode"

const DevicesOverview = ({ componentMode = "full", pageSelectorPropsSetter }: Props) => {
Expand All @@ -36,7 +36,7 @@ const DevicesOverview = ({ componentMode = "full", pageSelectorPropsSetter }: Pr
const { chargers } = useChargers()
const generatorFp = useGeneratorFp()
const generatorRelay = useGeneratorRelay()
const [compactBoxSize, setCompactBoxSize] = React.useState<{ width: number; height: number }>({ width: 0, height: 0 })
const [compactBoxSize, setCompactBoxSize] = useState<{ width: number; height: number }>({ width: 0, height: 0 })

const boxes = getAvailableDeviceBoxes(
chargers,
Expand Down
2 changes: 2 additions & 0 deletions src/app/Marine2/components/boxes/GeneratorFp/GeneratorFp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ const GeneratorFp = ({ componentMode = "compact", generatorFp, compactBoxSize }:
const title = productName || "Genset"
const subTitle = !!statusCode || statusCode === 0 ? gensetStateFormatter(Number(statusCode)) : undefined
const isAutoStartDisabled = gensetAutoStart === 0

// TODO refactor to totalPowerOf function for generic usage (single-source-of-truth).
const powerSum = power.reduce((sum: number, b) => {
return b ? sum + b : sum
}, 0)
Expand Down

0 comments on commit f3be72d

Please sign in to comment.