diff options
Diffstat (limited to 'lib/form-list/table/formLists-table.tsx')
| -rw-r--r-- | lib/form-list/table/formLists-table.tsx | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/lib/form-list/table/formLists-table.tsx b/lib/form-list/table/formLists-table.tsx index be252655..58ac4671 100644 --- a/lib/form-list/table/formLists-table.tsx +++ b/lib/form-list/table/formLists-table.tsx @@ -12,17 +12,17 @@ import { DataTable } from "@/components/data-table/data-table" import { DataTableAdvancedToolbar } from "@/components/data-table/data-table-advanced-toolbar" import { useFeatureFlags } from "./feature-flags-provider" -import { TagTypeClassFormMappings } from "@/db/schema/vendorData" import { getFormLists } from "../service" import { getColumns } from "./formLists-table-columns" import { FormListsTableToolbarActions } from "./formLists-table-toolbar-actions" import { ViewMetas } from "./meta-sheet" +import { ExtendedFormMappings } from "../validation" interface ItemsTableProps { promises: Promise< [ Awaited<ReturnType<typeof getFormLists>>, - ] + ] > } @@ -34,7 +34,7 @@ export function FormListsTable({ promises }: ItemsTableProps) { const [rowAction, setRowAction] = - React.useState<DataTableRowAction<TagTypeClassFormMappings> | null>(null) + React.useState<DataTableRowAction<ExtendedFormMappings> | null>(null) const columns = React.useMemo( () => getColumns({ setRowAction }), @@ -52,7 +52,7 @@ export function FormListsTable({ promises }: ItemsTableProps) { * @prop {React.ReactNode} [icon] - An optional icon to display next to the label. * @prop {boolean} [withCount] - An optional boolean to display the count of the filter option. */ - const filterFields: DataTableFilterField<TagTypeClassFormMappings>[] = [ + const filterFields: DataTableFilterField<ExtendedFormMappings>[] = [ ] @@ -67,18 +67,26 @@ export function FormListsTable({ promises }: ItemsTableProps) { * 3. Used with DataTableAdvancedToolbar: Enables a more sophisticated filtering UI. * 4. Date and boolean types: Adds support for filtering by date ranges and boolean values. */ - const advancedFilterFields: DataTableAdvancedFilterField<TagTypeClassFormMappings>[] = [ + const advancedFilterFields: DataTableAdvancedFilterField<ExtendedFormMappings>[] = [ + { + id: "projectCode", + label: "Project Code", + type: "text", + }, + { + id: "projectName", + label: "Project Name", + type: "text", + }, { id: "formCode", label: "Form Code", type: "text", - }, { id: "formName", label: "Form Name", type: "text", - }, { id: "tagTypeLabel", |
