From 840f5aa6ddacdba5e0a37a61f6bf5ace0ff6f44e Mon Sep 17 00:00:00 2001 From: Sianida26 Date: Wed, 7 Feb 2024 02:57:12 +0700 Subject: [PATCH] Lint --- .../users/_tables/UsersTable/UsersTable.tsx | 94 ++++++++++--------- src/app/dashboard/(auth)/users/page.tsx | 2 - 2 files changed, 50 insertions(+), 46 deletions(-) diff --git a/src/app/dashboard/(auth)/users/_tables/UsersTable/UsersTable.tsx b/src/app/dashboard/(auth)/users/_tables/UsersTable/UsersTable.tsx index 19e1624..ca0596c 100644 --- a/src/app/dashboard/(auth)/users/_tables/UsersTable/UsersTable.tsx +++ b/src/app/dashboard/(auth)/users/_tables/UsersTable/UsersTable.tsx @@ -10,59 +10,65 @@ import columns, { UserRow } from "./columns"; import { Table, Text } from "@mantine/core"; interface Props { - users: UserRow[] + users: UserRow[]; } -export default function UsersTable({users}: Props) { - +export default function UsersTable({ users }: Props) { const table = useReactTable({ data: users, columns, getCoreRowModel: getCoreRowModel(), defaultColumn: { - cell: (props) => {props.getValue() as React.ReactNode} - } + cell: (props) => {props.getValue() as React.ReactNode}, + }, }); - - // TODO: Add view when data is empty - + return ( - <> - - {/* Thead */} - - {table.getHeaderGroups().map((headerGroup) => ( - - {headerGroup.headers.map((header) => ( - - {header.isPlaceholder - ? null - : flexRender( - header.column.columnDef.header, - header.getContext() - )} - - ))} - - ))} - +
+ {/* Thead */} + + {table.getHeaderGroups().map((headerGroup) => ( + + {headerGroup.headers.map((header) => ( + + {header.isPlaceholder + ? null + : flexRender( + header.column.columnDef.header, + header.getContext() + )} + + ))} + + ))} + - {/* TBody */} - - {table.getRowModel().rows.map((row) => ( - - {row.getVisibleCells().map((cell) => ( - - {flexRender( - cell.column.columnDef.cell, - cell.getContext(), - )} - - ))} - - ))} - -
- + {/* TBody */} + + {table.getRowModel().rows.map((row) => ( + + {row.getVisibleCells().map((cell) => ( + + {flexRender( + cell.column.columnDef.cell, + cell.getContext() + )} + + ))} + + ))} + + ); } diff --git a/src/app/dashboard/(auth)/users/page.tsx b/src/app/dashboard/(auth)/users/page.tsx index 583fd0e..606126a 100644 --- a/src/app/dashboard/(auth)/users/page.tsx +++ b/src/app/dashboard/(auth)/users/page.tsx @@ -46,8 +46,6 @@ export default async function UsersPage({searchParams}: Props) { return null; } - // TODO: Add functinoality for create new user - return ( Users