- removed console.log
- fixed issue for more extensive check into tags to be more accurate
This commit is contained in:
@@ -11,10 +11,14 @@ type CameraStatusProps = {
|
||||
};
|
||||
|
||||
const CameraStatus = ({ title, category, isError }: CameraStatusProps) => {
|
||||
const isAllGood = category && category.length > 0 && category.every((status) => status.tags.includes("RUNNING"));
|
||||
// check if some are down
|
||||
// check if all are down
|
||||
//check if offline
|
||||
const isAllGood =
|
||||
category &&
|
||||
category.length > 0 &&
|
||||
category.every((status) => {
|
||||
const allowedTags = ["RUNNING", "VIDEO-PLAYING"];
|
||||
return status.tags.every((tag) => allowedTags.includes(tag));
|
||||
});
|
||||
|
||||
return (
|
||||
<Card className="p-4">
|
||||
<div className="border-b border-gray-600">
|
||||
|
||||
@@ -10,7 +10,10 @@ type CameraStatusGridItemProps = {
|
||||
|
||||
const CameraStatusGridItem = ({ title, statusCategory }: CameraStatusGridItemProps) => {
|
||||
const [isOpen, setIsOpen] = useState(false);
|
||||
const isAllGood = statusCategory?.every((status) => status.tags.includes("RUNNING"));
|
||||
const isAllGood = statusCategory?.every((status) => {
|
||||
const allowedTags = ["RUNNING", "VIDEO-PLAYING"];
|
||||
return status.tags.every((tag) => allowedTags.includes(tag));
|
||||
});
|
||||
|
||||
const handleClick = () => {
|
||||
setIsOpen(false);
|
||||
|
||||
Reference in New Issue
Block a user