tags owned by device are loaded with device page data, adding tag is object agnostic

This commit is contained in:
Carter 2025-01-22 13:44:56 -06:00
parent 4e7c68401b
commit 0076f2d208
8 changed files with 93 additions and 34 deletions

View file

@ -39,11 +39,12 @@ interface Props {
usage?: Usage;
loading?: boolean;
disableAddTag?: boolean;
tags: pond.Tag[];
}
export default function DeviceOverview(props: Props) {
const [{ user, firmware }] = useGlobalState();
const { device, components, usage, loading, disableAddTag } = props;
const { device, components, usage, loading, disableAddTag, tags } = props;
const prevComponents = usePrevious(components);
const { info } = useSnackbar();
const classes = useStyles();
@ -224,7 +225,7 @@ export default function DeviceOverview(props: Props) {
<StatusChip status="pending" />
</Grid>
)}
{user.allowedTo("provision") && <DeviceTags device={device} disableAdd={disableAddTag} />}
{user.allowedTo("provision") && <DeviceTags tags={tags} device={device} disableAdd={disableAddTag} />}
</Grid>
);
};