diff --git a/app/src/components/model/panels/bottom/BottomPanel.js b/app/src/components/model/panels/bottom/BottomPanel.js index 8188b6d2..b468253c 100644 --- a/app/src/components/model/panels/bottom/BottomPanel.js +++ b/app/src/components/model/panels/bottom/BottomPanel.js @@ -6,7 +6,6 @@ import { useState, useEffect } from "react"; import { useModelID } from "../../hooks/useModelID"; import { useSelectedComponent } from "../../hooks/useSelectedComponent"; import { useValidateQuery } from "../../../../api/gram/validation"; -import { COMPONENT_TYPE } from "../../board/constants"; export function BottomPanel() { const modelId = useModelID(); @@ -40,6 +39,12 @@ export function BottomPanel() { : []; } + const passedResults = validationResults.filter((result) => result.testResult); + const successRatio = + validationResults.length === 0 + ? 0 + : Number((passedResults.length / validationResults.length).toFixed(2)); + if (tab === 0) { // TAB.ALL filteredResults = allNegativeResults; @@ -78,6 +83,7 @@ export function BottomPanel() { modelLength={modelResults.length} selectedLength={selectedResults.length} selectedComponent={selectedComponent} + successRatio={successRatio} /> = 0.75) { + return "success"; + } else if (ratio >= 0.5) { + return "warning"; + } + return "error"; +} + export function BottomTabsHeader({ tab, setTab, @@ -32,6 +41,7 @@ export function BottomTabsHeader({ modelLength, selectedLength, selectedComponent, + successRatio, }) { return ( @@ -39,6 +49,7 @@ export function BottomTabsHeader({ sx={{ mx: 3, display: "flex", + gap: 1, justifyContent: "center", alignItems: "center", }} @@ -46,6 +57,12 @@ export function BottomTabsHeader({ QUALITY CHECK +