diff --git a/src/components/dashboard/overview/AllTransitionsLayout.tsx b/src/components/dashboard/overview/AllTransitionsLayout.tsx index 8f5faa9..f4428c7 100644 --- a/src/components/dashboard/overview/AllTransitionsLayout.tsx +++ b/src/components/dashboard/overview/AllTransitionsLayout.tsx @@ -34,10 +34,20 @@ const AllTransitionsLayout: React.FC = ({jobId}) => { const [showTable2, setShowTable2] = useState(false); const [displayMode, setDisplayMode] = useState("average"); const [pieChartDisplayMode, setPieChartDisplayMode] = useState("average"); - const [dataMode, setDataMode] = useState("Average"); - const transitionsDataAverage = useFetchData(`/activity_transitions_average/${jobId}`); + const [dataMode, setDataMode] = useState("AverageC"); + const transitionsDataAvgTransition = useFetchData(`/activity_transitions_average/${jobId}`); const transitionsDataTotal = useFetchData(`/activity_transitions/${jobId}`); - const transitionsData = dataMode === "Average" ? transitionsDataAverage : transitionsDataTotal; + const transitionsDataAvgCase = useFetchData(`/activity_transitions_average_case/${jobId}`); + let transitionsData; + + if (dataMode === "AverageC") { + transitionsData = transitionsDataAvgCase; + } else if (dataMode === "AverageT") { + transitionsData = transitionsDataAvgTransition; + } else { + transitionsData = transitionsDataTotal; + } + if (!overviewData || !transitionsData || !cteTableData || !potentialCteData || !timeframeData) { return
Loading...
; @@ -327,7 +337,8 @@ const AllTransitionsLayout: React.FC = ({jobId}) => { onChange={(e) => setDataMode(e.target.value)} label="Data Mode" > - Average by transition + Average by case + Average by transition Total