refactor: use DataTable for /bookings (#18589)
* refactor: use DataTable for /bookings * remove unnecessary animation (for better scroll performance) * add consistent search box
This commit is contained in:
1 parent
cce6e83578
commit
4f494d5a32
8 files changed
+226
-156
No files matched your search
@@ -12,25 +12,31 @@ import {
|
||||
|
||||
export type DataTableWrapperProps<TData, TValue> = {
|
||||
testId?: string;
|
||||
bodyTestId?: string;
|
||||
table: ReactTableType<TData>;
|
||||
isPending: boolean;
|
||||
hasNextPage: boolean;
|
||||
fetchNextPage: () => void;
|
||||
isFetching: boolean;
|
||||
hideHeader?: boolean;
|
||||
variant?: "default" | "compact";
|
||||
totalDBRowCount?: number;
|
||||
ToolbarLeft?: React.ReactNode;
|
||||
ToolbarRight?: React.ReactNode;
|
||||
children: React.ReactNode;
|
||||
children?: React.ReactNode;
|
||||
};
|
||||
|
||||
export function DataTableWrapper<TData, TValue>({
|
||||
testId,
|
||||
bodyTestId,
|
||||
table,
|
||||
isPending,
|
||||
hasNextPage,
|
||||
fetchNextPage,
|
||||
isFetching,
|
||||
totalDBRowCount,
|
||||
variant,
|
||||
hideHeader,
|
||||
ToolbarLeft,
|
||||
ToolbarRight,
|
||||
children,
|
||||
@@ -45,11 +51,14 @@ export function DataTableWrapper<TData, TValue>({
|
||||
|
||||
return (
|
||||
<DataTable
|
||||
data-testid={testId}
|
||||
testId={testId}
|
||||
bodyTestId={bodyTestId}
|
||||
table={table}
|
||||
tableContainerRef={tableContainerRef}
|
||||
isPending={isPending}
|
||||
enableColumnResizing={true}
|
||||
hideHeader={hideHeader}
|
||||
variant={variant}
|
||||
onScroll={(e) => fetchMoreOnBottomReached(e.target as HTMLDivElement)}>
|
||||
<DataTableToolbar.Root>
|
||||
<div className="flex w-full flex-col gap-2 sm:flex-row">
|
||||
|
||||
Reference in new issue
Block a user