test
This commit is contained in:
parent
e9958ce73e
commit
8902e24b12
|
@ -59,8 +59,11 @@ export default function Table({ items, count, headers, actions, offset, setOffse
|
|||
<tbody>
|
||||
{items.map((row, index) => (
|
||||
<tr className={index % 2 ? "bg-white" : "bg-gray-50"} key={index}>
|
||||
{headers.map(({ key, formatter }) => (
|
||||
<td key={key} className="px-6 py-4 text-sm font-medium text-gray-900">
|
||||
{headers.map(({ key, formatter, nowrap }) => (
|
||||
<td
|
||||
key={key}
|
||||
className={`${nowrap ? "whitespace-nowrap" : ""} px-6 py-4 text-sm font-medium text-gray-900`}
|
||||
>
|
||||
{(formatter ? formatter(row[key]) : row[key]) || <>—</>}
|
||||
</td>
|
||||
))}
|
||||
|
|
|
@ -8,7 +8,7 @@ import Table from "../components/Table";
|
|||
const apiPrefix = process.env.NODE_ENV === "development" ? "/api/stubs" : "";
|
||||
const fetcher = (url) => fetch(url).then((r) => r.json());
|
||||
const headers = [
|
||||
{ key: "name", name: "Name" },
|
||||
{ key: "name", name: "Name", nowrap: false },
|
||||
{ key: "skylink", name: "Skylink" },
|
||||
{ key: "size", name: "Size", formatter: prettyBytes },
|
||||
{ key: "downloadedOn", name: "Accessed on", formatter: (date) => dayjs(date).format("YYYY-MM-DD HH:mm:ss") },
|
||||
|
|
|
@ -8,7 +8,7 @@ import Table from "../components/Table";
|
|||
const apiPrefix = process.env.NODE_ENV === "development" ? "/api/stubs" : "";
|
||||
const fetcher = (url) => fetch(url).then((r) => r.json());
|
||||
const headers = [
|
||||
{ key: "name", name: "Name" },
|
||||
{ key: "name", name: "Name", nowrap: false },
|
||||
{ key: "skylink", name: "Skylink" },
|
||||
{ key: "size", name: "Size", formatter: prettyBytes },
|
||||
{ key: "uploadedOn", name: "Uploaded on", formatter: (date) => dayjs(date).format("YYYY-MM-DD HH:mm:ss") },
|
||||
|
|
Reference in New Issue