Skip to content

Commit

Permalink
Develop (#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
walbuc authored Sep 5, 2024
2 parents 300e25c + cd79470 commit 52b94eb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/components/TableFooter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@ import {selectLoadingState} from "../state/loading";
type TData = Record<string, any> & Record<string, string | number>;
type Props = {table: MRT_TableInstance<TData>} & Pick<ViewProps, "result"> & {
data?: Record<string, string | number>[];
isLoading: boolean;
};

function TableFooter(props: Props) {
const loading = useSelector(selectLoadingState);
const {result, table, data = []} = props;
const {result, table, data = [], isLoading} = props;
const {translate: t} = useTranslation();
const {url} = result;

Expand All @@ -44,7 +45,7 @@ function TableFooter(props: Props) {
gap="sm"
>
<CubeSource />
{!loading.loading && (
{!loading.loading && !isLoading && (
<Group position="right" spacing="sm">
{totalRowCount && <Text c="dimmed">{t("results.count_rows", {n: totalRowCount})}</Text>}
{showPagination && <MRT_TablePagination table={table} />}
Expand All @@ -60,6 +61,7 @@ type ApiAndCsvButtonsProps = {
copied: boolean;
copyHandler: () => void;
url: string;
data: Record<string, string | number>[];
};
const ApiAndCsvButtons: React.FC<ApiAndCsvButtonsProps> = props => {
const {copied, copyHandler, url, data} = props;
Expand Down
2 changes: 1 addition & 1 deletion src/components/TableView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,7 @@ export function TableView({table, result, isError, isLoading = false, data, colu
{!isData && !isError && !isLoading && <NoRecords />}
</ScrollArea>
<MRT_ToolbarAlertBanner stackAlertBanner table={table} />
<TableFooter table={table} data={data} result={result} />
<TableFooter table={table} data={data} result={result} isLoading={isLoading} />
</Flex>
</Box>
);
Expand Down

0 comments on commit 52b94eb

Please sign in to comment.