();
const conceptUuids = config?.resultsViewerConcepts?.map((c) => c.conceptUuid) ?? [];
const { roots, error } = useGetManyObstreeData(patientUuid, conceptUuids);
const { timelineData, tableData, totalResultsCount, filteredResultsCount, resetTree, isLoading } =
useContext(FilterContext);
if (error) {
return ;
}
// Don't show empty state while loading - wait for data to finish loading
if (isLoading) {
return ;
}
if (!roots || roots.length === 0) {
return (
);
}
if (tablet) {
return (
<>
{!isLoading && view === 'over-time' ? (
) : view === 'individual-test' ? (
) : (
)}
{showTreeOverlay && (
setShowTreeOverlay(false)}
buttonsGroup={
}
>
{!isLoading ? : }
)}
>
);
}
return (
<>
{!expanded && (
)}
{isLoading ? (
) : view === 'individual-test' ? (
tableData && tableData.length > 0 ? (
) : (
)
) : view === 'over-time' ? (
) : null}
>
);
};
export default TreeView;