diff --git a/resources/js/components/data-table.tsx b/resources/js/components/data-table.tsx index 6bc5656..4edea72 100644 --- a/resources/js/components/data-table.tsx +++ b/resources/js/components/data-table.tsx @@ -160,14 +160,39 @@ export function DataTable({ return (
-
-
+
+
setGlobalFilter(event.target.value)} className="max-w-sm" /> +
+ +
+ {selectedRows.length > 0 && bulkActions && ( + + + + + + {bulkActions.map((action, i) => ( + action.onClick(selectedRows.map((r) => r.original))} + className={action.variant === "destructive" ? "text-red-600 focus:text-red-600" : ""} + > + {action.icon && } + {action.label} + + ))} + + + )} {filters && filters.length > 0 && ( @@ -177,7 +202,7 @@ export function DataTable({ Filter - + Filter Berdasarkan {filters.map((filter) => { @@ -216,64 +241,41 @@ export function DataTable({ )} - {selectedRows.length > 0 && bulkActions && ( - - - - - - {bulkActions.map((action, i) => ( - action.onClick(selectedRows.map((r) => r.original))} - className={action.variant === "destructive" ? "text-red-600 focus:text-red-600" : ""} - > - {action.icon && } - {action.label} - - ))} - - - )} + + + + + + Tampilan Kolom + + {table + .getAllColumns() + .filter((column) => column.getCanHide()) + .map((column) => { + return ( + column.toggleVisibility(!!value)} + onSelect={(e) => e.preventDefault()} + > + {(column.columnDef.meta as any)?.title || + (typeof column.columnDef.header === "string" + ? column.columnDef.header + : String(column.id).replace(/_/g, " "))} + + ); + })} + +
- - - - - - - Tampilan Kolom - - {table - .getAllColumns() - .filter((column) => column.getCanHide()) - .map((column) => { - return ( - column.toggleVisibility(!!value)} - onSelect={(e) => e.preventDefault()} - > - {(column.columnDef.meta as any)?.title || - (typeof column.columnDef.header === "string" - ? column.columnDef.header - : String(column.id).replace(/_/g, " "))} - - ); - })} - -
-
+
{table.getHeaderGroups().map((headerGroup) => ( @@ -333,13 +335,13 @@ export function DataTable({
-
-
+
+
{table.getFilteredSelectedRowModel().rows.length} dari{" "} {table.getFilteredRowModel().rows.length} baris dipilih.
-
-
+
+

Baris per halaman