Skip to content

Commit

Permalink
Support className prop for DataTable component
Browse files Browse the repository at this point in the history
  • Loading branch information
CalvinWalzel committed Sep 17, 2024
1 parent 9e913fc commit 889a898
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/frontend/components/data_table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,20 @@ import {
TableRow,
} from "@/components/ui/table";

import { cn } from "@/utils/ui";

interface DataTableProps<TData, TValue> {
columns: ColumnDef<TData, TValue>[];
data: TData[];
pagination: PaginatorProps;
className?: string;
}

export function DataTable<TData, TValue>({
columns,
data,
pagination,
className,
}: DataTableProps<TData, TValue>) {
const table = useReactTable({
data,
Expand All @@ -38,7 +42,7 @@ export function DataTable<TData, TValue>({

return (
<>
<div className="rounded-md border">
<div className={cn(className)}>
<Table>
<TableHeader>
{table.getHeaderGroups().map((headerGroup) => (
Expand Down

0 comments on commit 889a898

Please sign in to comment.