This commit is contained in:
2024-06-24 20:26:33 +05:30
24 changed files with 564 additions and 73 deletions

View File

@@ -1,5 +1,16 @@
import React from "react";
import { Table, TableContainer, Tbody, Td, Th, Thead, Tr, Skeleton, TableCaption, Tfoot } from "@chakra-ui/react";
import {
Table,
TableContainer,
Tbody,
Td,
Th,
Thead,
Tr,
Skeleton,
TableCaption,
Tfoot,
} from "@chakra-ui/react";
import EmptySearchList from "../EmptySearchList";
import Pagination from "../Pagination";
@@ -16,7 +27,7 @@ const DataTable = ({ data, isLoading, tableHeadRow, emptyMessage, totalPages })
<Thead backgroundColor="gray.50">
<Tr>
{tableHeadRow.map((heading, index) => (
<Th key={index} p={3} w={columnWidth}>
<Th key={index} p={3} w={"auto"} color={"#004118"}>
{isLoading ? <Skeleton height="20px" /> : heading}
{/* {heading} */}
</Th>
@@ -28,7 +39,15 @@ const DataTable = ({ data, isLoading, tableHeadRow, emptyMessage, totalPages })
? Array?.from({ length: 10 }).map((_, index) => (
<Tr key={index}>
{tableHeadRow.map((_, i) => (
<Td key={i} style={{ whiteSpace: "nowrap", textOverflow: "ellipsis" }} className="web-text-small" w={columnWidth}>
<Td
key={i}
style={{
whiteSpace: "nowrap",
textOverflow: "ellipsis",
}}
className="web-text-small"
w={columnWidth}
>
<Skeleton height="20px" mb={1} mt={1} />
</Td>
))}
@@ -37,7 +56,15 @@ const DataTable = ({ data, isLoading, tableHeadRow, emptyMessage, totalPages })
: data?.map((item, index) => (
<Tr key={index}>
{tableHeadRow.map((heading, i) => (
<Td color={"gray.600"} key={i} style={{ whiteSpace: "nowrap", textOverflow: "ellipsis" }} className="web-text-small" >
<Td
color={"gray.600"}
key={i}
style={{
whiteSpace: "nowrap",
textOverflow: "ellipsis",
}}
className="web-text-small"
>
{item[heading]}
</Td>
))}