All files / src/pages/flowsheet-page/flowsheet/Canvas DefinedStatusIcon.tsx

100% Statements 7/7
100% Branches 1/1
100% Functions 2/2
100% Lines 7/7

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26                        1484x 1484x   1484x 3105x     1484x 490x     994x    
import { ListChecks, ListX } from "lucide-react";
import { StatusIndicator } from "../../../../ahuora-design-system/ui/ui-status-indicator";
import {
  useCurrentGroupId,
  useGroupGraphicsObjects,
} from "../../../../hooks/flowsheetObjects";
 
export function DefinedStatusIcon({
  className
}: {
  className?: string
}) {
  const groupId = useCurrentGroupId();
  const objects = useGroupGraphicsObjects(groupId);
 
  const hasUnderdefined = objects?.some(
    (object) => object.simulationObject.unspecifiedProperties.length > 0,
  );
 
  if (!hasUnderdefined) {
    return <ListChecks className={className} />;
  }
 
  return <ListX className={className} color="hsl(var(--destructive))" />;
}