diff --git a/src/components/datasets/datatype/DataTypeSummaryModal.js b/src/components/datasets/datatype/DataTypeSummaryModal.js index 6a6c7fa31..cba79bd29 100644 --- a/src/components/datasets/datatype/DataTypeSummaryModal.js +++ b/src/components/datasets/datatype/DataTypeSummaryModal.js @@ -8,20 +8,23 @@ import VariantSummary from "./VariantSummary"; import { useSelector } from "react-redux"; const DataTypeSummaryModal = ({dataType, summary, onCancel, visible}) => { - summary = summary || {}; - dataType = dataType || {}; + if (!dataType) { + return <>; + } const isFetchingSummaries = useSelector((state) => state.datasetDataTypes.isFetching); let Summary = GenericSummary; + let summaryData = summary; switch (dataType.id) { case "variant": - // TODO: variant summary Summary = VariantSummary; break; case "phenopacket": Summary = PhenopacketSummary; break; + default: + summaryData = summary ?? dataType; } return <> @@ -32,9 +35,9 @@ const DataTypeSummaryModal = ({dataType, summary, onCancel, visible}) => { {dataType.id} } > - {(!summary || isFetchingSummaries) + {(!summaryData || isFetchingSummaries) ? - : } + : } ; };