10 changed files with 221 additions and 48 deletions
@ -1,15 +1,23 @@ |
|||||||
import React from "react"; |
import React from "react"; |
||||||
|
import { Box, Text } from "grommet"; |
||||||
|
import { StatusGoodSmall } from "grommet-icons"; |
||||||
|
|
||||||
import { stateToEmoji } from "../../utils/indi"; |
import { stateToColor } from "../../utils/indi"; |
||||||
|
|
||||||
const LightVector = ({ vector }) => { |
const LightVector = ({ vector }) => { |
||||||
return ( |
return ( |
||||||
<div> |
<Box gap="xsmall"> |
||||||
{vector.values.map(v => ( |
{vector.values.map((v) => ( |
||||||
<div key={v.name}>{stateToEmoji(v.switch)} {v.label || v.name}</div> |
<Box key={v.name} direction="row" align="center" gap="small"> |
||||||
|
<StatusGoodSmall |
||||||
|
size="medium" |
||||||
|
color={stateToColor(v.light)} |
||||||
|
/> |
||||||
|
<Box><Text>{v.label || v.name}</Text></Box> |
||||||
|
</Box> |
||||||
))} |
))} |
||||||
</div> |
</Box> |
||||||
); |
); |
||||||
}; |
}; |
||||||
|
|
||||||
export default LightVector; |
export default LightVector; |
||||||
|
|||||||
Loading…
Reference in new issue