diff --git a/src/components/data_search/DatasetSearchTable.jsx b/src/components/data_search/DatasetSearchTable.jsx index a9d916f9b..1e5529c99 100644 --- a/src/components/data_search/DatasetSearchTable.jsx +++ b/src/components/data_search/DatasetSearchTable.jsx @@ -281,7 +281,7 @@ export const DatasetSearchTable = (props) => { > {Object.values(datasetSearchTableTabs).map((tab) => { key: string; - label: string; + singular: string; + plural: string; makeHeaders: (datasets: DatasetTerm[], selected: number[], onSelect: (datasetIds: number[]) => void, exportableDatasets: { [duosId: string]: SnapshotSummaryModel[] }) => HeaderData[]; makeRows: (datasets: DatasetTerm[], headers: HeaderData[]) => CellData[][]; } @@ -442,13 +443,15 @@ export const makeDatasetTableRows = (datasets: DatasetTerm[], headers: HeaderDat export const datasetSearchTableTabs: DatasetSearchTableTabs = { study: { key: 'study-table-tab', - label: 'View By Studies', + singular: 'study', + plural: 'studies', makeHeaders: makeStudyTableHeaders, makeRows: makeStudyTableRowData, }, dataset: { key: 'datasets-table-tab', - label: 'View By Datasets', + singular: 'dataset', + plural: 'datasets', makeHeaders: makeDatasetTableHeader, makeRows: makeDatasetTableRows, } diff --git a/src/components/data_search/DatasetSearchTableDisplay.tsx b/src/components/data_search/DatasetSearchTableDisplay.tsx index f469a8e77..71f33f2e9 100644 --- a/src/components/data_search/DatasetSearchTableDisplay.tsx +++ b/src/components/data_search/DatasetSearchTableDisplay.tsx @@ -1,5 +1,4 @@ import * as React from 'react'; -import {Box} from '@mui/material'; import {isEmpty} from 'lodash'; import {DatasetTerm} from 'src/types/model'; import SimpleTable from '../SimpleTable'; @@ -8,6 +7,7 @@ import { DatasetSearchTableTab, } from './DatasetSearchTableConstants'; import {SnapshotSummaryModel} from '../../types/tdrModel'; +import * as _ from 'lodash'; const styles = { baseStyle: { @@ -54,21 +54,23 @@ export const DatasetSearchTableDisplay = (props: DatasetSearchTableDisplayProps) const headers = tab.makeHeaders(filteredData, selected, onSelect, exportableDatasets); const rowData = tab.makeRows(filteredData, headers); - return isEmpty(filteredData) ? ( - -

There are no datasets that fit these criteria.

-
- ) - : ( - - ); + return <> +
+ {rowData.length} {_.capitalize(rowData.length !== 1 ? tab.plural : tab.singular)} +
+ { + isEmpty(filteredData) ? +
There are no {tab.plural} that fit these criteria.
: + + } + ; };