From bb1eb16e268fb13c8791fa9e7ae76074a36cc56e Mon Sep 17 00:00:00 2001 From: Caden Buckhalt Date: Fri, 2 Feb 2024 14:10:25 -0800 Subject: [PATCH] linting data-table --- .../data-table/advanced/data-table-multi-filter.tsx | 11 ++++++----- components/data-table/data-table-faceted-filter.tsx | 5 ++--- components/data-table/data-table-toolbar.tsx | 5 +++-- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/components/data-table/advanced/data-table-multi-filter.tsx b/components/data-table/advanced/data-table-multi-filter.tsx index 66ea8a16..16d4b30d 100644 --- a/components/data-table/advanced/data-table-multi-filter.tsx +++ b/components/data-table/advanced/data-table-multi-filter.tsx @@ -29,6 +29,7 @@ import { Separator } from '~/components/ui/separator'; import { DataTableFacetedFilter } from '../data-table-faceted-filter'; import { type DataTableFilterOption } from '~/lib/data-table/types'; import { AlignCenter, Copy, MoreHorizontal, Trash } from 'lucide-react'; +import { type Route } from 'next'; const operators = [ { @@ -48,7 +49,7 @@ type DataTableMultiFilterProps = { setSelectedOptions: React.Dispatch< React.SetStateAction[]> >; -} +}; export function DataTableMultiFilter({ table, @@ -115,7 +116,7 @@ type MultiFilterRowProps = { setOperator: React.Dispatch< React.SetStateAction<(typeof operators)[number] | undefined> >; -} & DataTableMultiFilterProps +} & DataTableMultiFilterProps; export function MultiFilterRow({ i, @@ -176,7 +177,7 @@ export function MultiFilterRow({ [selectedOption?.value ?? '']: `${debounceValue}${ debounceValue.length > 0 ? `.${filterVariety}` : '' }`, - })}`, + })}` as Route, { scroll: false, }, @@ -187,7 +188,7 @@ export function MultiFilterRow({ router.push( `${pathname}?${createQueryString({ [selectedOption?.value ?? '']: null, - })}`, + })}` as Route, { scroll: false, }, @@ -202,7 +203,7 @@ export function MultiFilterRow({ router.push( `${pathname}?${createQueryString({ operator: operator.value, - })}`, + })}` as Route, { scroll: false, }, diff --git a/components/data-table/data-table-faceted-filter.tsx b/components/data-table/data-table-faceted-filter.tsx index 276c0c8f..c86efa0b 100644 --- a/components/data-table/data-table-faceted-filter.tsx +++ b/components/data-table/data-table-faceted-filter.tsx @@ -25,7 +25,7 @@ type DataTableFacetedFilter = { title?: string; options: Option[]; variant?: 'popover' | 'command'; -} +}; export function DataTableFacetedFilter({ column, @@ -144,8 +144,7 @@ export function DataTableFacetedFilter({ No results found. diff --git a/components/data-table/data-table-toolbar.tsx b/components/data-table/data-table-toolbar.tsx index 9c721c99..c3f8db9b 100644 --- a/components/data-table/data-table-toolbar.tsx +++ b/components/data-table/data-table-toolbar.tsx @@ -13,14 +13,15 @@ import { } from '~/lib/data-table/types'; import { Cross, PlusCircle, Trash } from 'lucide-react'; import { cn } from '~/utils/shadcn'; +import { type UrlObject } from 'url'; type DataTableToolbarProps = { table: Table; filterableColumns?: DataTableFilterableColumn[]; searchableColumns?: DataTableSearchableColumn[]; - newRowLink?: string; + newRowLink?: UrlObject; deleteRowsAction?: React.MouseEventHandler; -} +}; export function DataTableToolbar({ table,