Przeglądaj źródła

領収書一覧 データない場合にテーブルを表示しないように修正

develop
sosuke.iwabuchi 2 lat temu
rodzic
commit
4622b91d72
1 zmienionych plików z 14 dodań i 2 usunięć
  1. +14
    -2
      src/pages/dashboard/receipt/download.tsx

+ 14
- 2
src/pages/dashboard/receipt/download.tsx Wyświetl plik

@@ -15,7 +15,7 @@ import useAPICall from "hooks/useAPICall";
import useDashboard from "hooks/useDashBoard";
import useTable from "hooks/useTable";
import { PageID, TabID } from "pages";
import { useEffect } from "react";
import { useEffect, useState } from "react";
import { numberFormat } from "utils/string";

const TABLE_HEAD: HeadLabelProps[] = [
@@ -31,6 +31,8 @@ export default function ReceiptDownload() {
TabID.NONE
);

const [fetched, setFetched] = useState(false);

const {
order,
page,
@@ -57,7 +59,9 @@ export default function ReceiptDownload() {
});

useEffect(() => {
callGetReceipts({});
callGetReceipts({}).then(() => {
setFetched(true);
});
}, []);

useEffect(() => {
@@ -65,6 +69,14 @@ export default function ReceiptDownload() {
setTabs(null);
}, [setHeaderTitle, setTabs]);

if (!fetched) {
return null;
}

if (dataLength === 0) {
return <Box>データがありません</Box>;
}

return (
<Box>
<TableContainer


Ładowanie…
Anuluj
Zapisz