-
-
Rows per page
+
+
{table.getCoreRowModel().rows.length} items
+
+ per page
-
- Page {table.getState().pagination.pageIndex + 1} of{" "}
- {table.getPageCount()}
-
-
-
-
-
-
-
+
+
+
+
+ {table.getState().pagination.pageIndex + 1} / {table.getPageCount()}
+
+
+
+
+
);
diff --git a/apps/app/src/components/data-table/data-table-toolbar.tsx b/apps/app/src/components/data-table/data-table-toolbar.tsx
index bf0811821..739a2ab9c 100644
--- a/apps/app/src/components/data-table/data-table-toolbar.tsx
+++ b/apps/app/src/components/data-table/data-table-toolbar.tsx
@@ -1,7 +1,7 @@
"use client";
import type { Column, Table } from "@tanstack/react-table";
-import { Plus, X } from "lucide-react";
+import { Plus, Search, X } from "lucide-react";
import * as React from "react";
import { Button } from "@comp/ui/button";
@@ -45,7 +45,7 @@ export function DataTableToolbar
({
role="toolbar"
aria-orientation="horizontal"
className={cn(
- "flex w-full items-start justify-between mb-4 gap-2",
+ "flex w-full items-center justify-between gap-2",
className,
)}
{...props}
@@ -59,29 +59,30 @@ export function DataTableToolbar({
aria-label="Reset filters"
variant="outline"
size="sm"
- className="border-dashed"
+ className="border-dashed rounded-sm"
onClick={onReset}
>
-
- Reset
+
+ Reset
)}
+
{children}
-
+ {/*
*/}
{sheet && (
)}
@@ -105,16 +106,19 @@ function DataTableToolbarFilter
({
switch (columnMeta.variant) {
case "text":
return (
-
- column.setFilterValue(event.target.value)
- }
- className="h-8 w-40 md:w-56"
- />
+
+ }
+ placeholder={
+ columnMeta.placeholder ?? columnMeta.label
+ }
+ value={(column.getFilterValue() as string) ?? ""}
+ onChange={(event) => {
+ column.setFilterValue(event.target.value);
+ }}
+ className="h-9 w-full min-w-[14rem] md:min-w-[18rem] rounded-sm"
+ />
+
);
case "number":
@@ -133,12 +137,12 @@ function DataTableToolbarFilter({
column.setFilterValue(event.target.value)
}
className={cn(
- "h-8 w-[120px]",
+ "h-9 w-[120px] rounded-sm",
columnMeta.unit && "pr-8",
)}
/>
{columnMeta.unit && (
-
+
{columnMeta.unit}
)}
diff --git a/apps/app/src/components/data-table/data-table.tsx b/apps/app/src/components/data-table/data-table.tsx
index deecd1400..b8def90f5 100644
--- a/apps/app/src/components/data-table/data-table.tsx
+++ b/apps/app/src/components/data-table/data-table.tsx
@@ -42,6 +42,9 @@ export function DataTable({
}
};
+ // Apply client-side filtering
+ const filteredRows = table.getFilteredRowModel().rows;
+
return (
({
))}
- {table.getRowModel().rows?.length ? (
- table.getRowModel().rows.map((row) => (
+ {filteredRows.length ? (
+ filteredRows.map((row) => (
diff --git a/apps/app/src/hooks/use-data-table.ts b/apps/app/src/hooks/use-data-table.ts
index 84c91692c..facd0e6a4 100644
--- a/apps/app/src/hooks/use-data-table.ts
+++ b/apps/app/src/hooks/use-data-table.ts
@@ -125,7 +125,7 @@ export function useDataTable(props: UseDataTableProps) {
perPageKey,
parseAsInteger
.withOptions(queryStateOptions)
- .withDefault(initialState?.pagination?.pageSize ?? 10),
+ .withDefault(initialState?.pagination?.pageSize ?? 50),
);
const pagination: PaginationState = React.useMemo(() => {
@@ -304,7 +304,7 @@ export function useDataTable(props: UseDataTableProps) {
getFacetedMinMaxValues: getFacetedMinMaxValues(),
manualPagination: true,
manualSorting: pageCount !== 1,
- manualFiltering: true,
+ manualFiltering: false,
});
return { table, shallow, debounceMs, throttleMs };
diff --git a/apps/app/src/lib/validations.ts b/apps/app/src/lib/validations.ts
index 91742d560..2b24b5bcd 100644
--- a/apps/app/src/lib/validations.ts
+++ b/apps/app/src/lib/validations.ts
@@ -11,7 +11,7 @@ import * as z from "zod";
export const searchParamsCache = createSearchParamsCache({
page: parseAsInteger.withDefault(1),
- perPage: parseAsInteger.withDefault(10),
+ perPage: parseAsInteger.withDefault(50),
sort: getSortingStateParser().withDefault([
{ id: "createdAt", desc: true },
]),
diff --git a/apps/framework-editor/package.json b/apps/framework-editor/package.json
index a38fe5425..6fbb77a71 100644
--- a/apps/framework-editor/package.json
+++ b/apps/framework-editor/package.json
@@ -33,7 +33,7 @@
"@radix-ui/react-separator": "1.1.1",
"@radix-ui/react-slider": "1.2.2",
"@radix-ui/react-slot": "1.1.1",
- "@radix-ui/react-switch": "1.2.4",
+ "@radix-ui/react-switch": "1.2.5",
"@radix-ui/react-tabs": "1.1.2",
"@radix-ui/react-toast": "1.2.4",
"@radix-ui/react-toggle": "1.1.1",
diff --git a/apps/trust/package.json b/apps/trust/package.json
index 773003599..68ab0395e 100644
--- a/apps/trust/package.json
+++ b/apps/trust/package.json
@@ -33,7 +33,7 @@
"@radix-ui/react-separator": "1.1.1",
"@radix-ui/react-slider": "1.2.2",
"@radix-ui/react-slot": "1.1.1",
- "@radix-ui/react-switch": "1.2.4",
+ "@radix-ui/react-switch": "1.2.5",
"@radix-ui/react-tabs": "1.1.2",
"@radix-ui/react-toast": "1.2.4",
"@radix-ui/react-toggle": "1.1.1",
diff --git a/packages/ui/package.json b/packages/ui/package.json
index 310618a5d..42d0da84f 100644
--- a/packages/ui/package.json
+++ b/packages/ui/package.json
@@ -113,7 +113,7 @@
"@radix-ui/react-separator": "^1.1.0",
"@radix-ui/react-slider": "^1.2.1",
"@radix-ui/react-slot": "^1.1.0",
- "@radix-ui/react-switch": "^1.2.4",
+ "@radix-ui/react-switch": "^1.2.5",
"@radix-ui/react-tabs": "^1.1.1",
"@radix-ui/react-toast": "^1.2.2",
"@radix-ui/react-tooltip": "^1.1.3",