From 47a0ccc88c088a6b2297f399fcc838de05cec5d9 Mon Sep 17 00:00:00 2001 From: Sean O'Connor Date: Sun, 10 May 2026 03:10:37 -0400 Subject: [PATCH] fix: remove extra bottom padding from filter and pagination bars CardContent defaults to px-5 pb-4. Tailwind's CSS cascade means pb-4 always wins over the py-0 override, leaving 16px of phantom bottom padding on all thin toolbar cards. Replaced CardContent with plain divs carrying the intended py-2 px-3 directly. Co-Authored-By: Claude Sonnet 4.6 --- src/components/data/data-table.tsx | 258 ++++++++++++++--------------- 1 file changed, 125 insertions(+), 133 deletions(-) diff --git a/src/components/data/data-table.tsx b/src/components/data/data-table.tsx index fb1f553..4d75274 100644 --- a/src/components/data/data-table.tsx +++ b/src/components/data/data-table.tsx @@ -29,7 +29,7 @@ import { import * as React from "react"; import { Button } from "~/components/ui/button"; -import { Card, CardContent } from "~/components/ui/card"; +import { Card } from "~/components/ui/card"; import { DropdownMenu, DropdownMenuCheckboxItem, @@ -231,115 +231,113 @@ export function DataTable({ {/* Filter Bar Card */} {(showSearch || filterableColumns.length > 0 || showColumnVisibility) && ( - - -
- {showSearch && ( -
- - setSearchInput(event.target.value)} - className="h-9 w-full pr-3 pl-9" - /> -
- )} - {filterableColumns.map((column) => ( - - ))} - {filterableColumns.length > 0 && ( - - )} - {showColumnVisibility && ( - - - + )} + {showColumnVisibility && ( + + + + + + {table + .getAllColumns() + .filter((column) => column.getCanHide()) + .map((column) => { + return ( + + column.toggleVisibility(!!value) + } + > + {column.id} + + ); + })} + + + )} +
)} {/* Selection Toolbar */} {selectionActions && table.getSelectedRowModel().rows.length > 0 && ( - - + +
{table.getSelectedRowModel().rows.length} selected @@ -349,7 +347,7 @@ export function DataTable({ () => table.resetRowSelection(), )}
-
+
)} @@ -435,9 +433,8 @@ export function DataTable({ {/* Pagination Bar Card */} {showPagination && ( - - -
+ +

{table.getFilteredRowModel().rows.length === 0 @@ -537,8 +534,7 @@ export function DataTable({ Last page

-
- +
)} @@ -596,13 +592,11 @@ export function DataTableSkeleton({ return (
{/* Filter bar skeleton */} - - -
-
-
-
-
+ +
+
+
+
{/* Table skeleton */} @@ -667,23 +661,21 @@ export function DataTableSkeleton({
{/* Pagination skeleton */} - - -
-
-
-
-
-
- {Array.from({ length: 5 }).map((_, i) => ( -
- ))} -
+ +
+
+
+
- +
+ {Array.from({ length: 5 }).map((_, i) => ( +
+ ))} +
+
);