11import type { PropsWithChildren } from "react" ;
2- import type { FeatureWithAnySubFeatures , LastSeenConfig } from "../../types.js" ;
3- import { type BaseFeatureProps , getFeatureKey } from "../features/index.js" ;
2+ import type { DeviceState , FeatureWithAnySubFeatures , LastSeenConfig } from "../../types.js" ;
3+ import { type BaseWithSubFeaturesProps , getFeatureKey } from "../features/index.js" ;
44
55import { Link } from "react-router" ;
66
@@ -13,8 +13,9 @@ import { Lqi } from "../value-decorators/Lqi.js";
1313import PowerSource from "../value-decorators/PowerSource.js" ;
1414import { DeviceImage } from "./DeviceImage.js" ;
1515
16- type Props = Omit < BaseFeatureProps < FeatureWithAnySubFeatures > , "feature" > &
16+ type Props = Omit < BaseWithSubFeaturesProps < FeatureWithAnySubFeatures > , "feature" | "deviceState "> &
1717 PropsWithChildren < {
18+ deviceState : DeviceState ;
1819 features : FeatureWithAnySubFeatures [ ] ;
1920 lastSeenConfig : LastSeenConfig ;
2021 endpoint ?: string | number ;
@@ -38,7 +39,7 @@ export default function DeviceCard({
3839 < li className = "list-row flex-grow" >
3940 < div className = "h-12 w-12" style = { { overflow : "visible" } } >
4041 { /* disabled always false because dashboard does not contain disabled devices */ }
41- < DeviceImage disabled = { false } device = { device } deviceState = { deviceState } />
42+ < DeviceImage disabled = { false } device = { device } otaState = { deviceState . update } />
4243 </ div >
4344 < div >
4445 < Link to = { `/device/${ device . ieee_address } ` } className = "link link-hover" >
@@ -74,7 +75,7 @@ export default function DeviceCard({
7475 </ li >
7576 < li className = "flex flex-row flex-wrap gap-1 m-4 justify-around items-center" >
7677 < span className = "badge badge-soft badge-ghost cursor-default" title = { t ( "last_seen" ) } >
77- < LastSeen state = { deviceState } config = { lastSeenConfig } />
78+ < LastSeen lastSeen = { deviceState . last_seen } config = { lastSeenConfig } />
7879 </ span >
7980 < span className = "badge badge-soft badge-ghost cursor-default" title = { t ( "lqi" ) } >
8081 < Lqi value = { deviceState . linkquality as number | undefined } />
0 commit comments