fix: invalidate queries better
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
import type { UseQueryResult } from '@tanstack/react-query';
|
||||
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { DataTable } from '@/components/ui/data-table/data-table';
|
||||
import { DataTableToolbar } from '@/components/ui/data-table/data-table-toolbar';
|
||||
import { useTable } from '@/components/ui/data-table/use-table';
|
||||
import { pushModal } from '@/modals';
|
||||
import type { RouterOutputs } from '@/trpc/client';
|
||||
import { PlusIcon } from 'lucide-react';
|
||||
import { useColumns } from './columns';
|
||||
|
||||
type Props = {
|
||||
@@ -23,7 +26,15 @@ export const ClientsTable = ({ query }: Props) => {
|
||||
|
||||
return (
|
||||
<>
|
||||
<DataTableToolbar table={table} />
|
||||
<DataTableToolbar table={table}>
|
||||
<Button
|
||||
icon={PlusIcon}
|
||||
responsive
|
||||
onClick={() => pushModal('AddClient')}
|
||||
>
|
||||
Create client
|
||||
</Button>
|
||||
</DataTableToolbar>
|
||||
<DataTable table={table} loading={isLoading} />
|
||||
</>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user