import "./components/FormsCell.js"; import { ColumnDef } from "@tanstack/react-table"; import { useI18n } from "../../../hooks/useI18n.js"; import type { FormType } from "../../../interfaces"; import { Table, TableProps } from "../../../molecules/table/Table"; import { getComponent } from "../../../registries/components.js"; import { FormsCell } from "./components/FormsCell.js"; export type FormsTableProps = Omit, "columns"> & { tags?: { label: string; value: string }[]; }; export function FormsTable({ tags, ...props }: FormsTableProps) { const { t } = useI18n(props.i18n); const Cell = getComponent("FormsCell"); const columns: ColumnDef[] = [ { header: t("Title"), accessorKey: "title", cell: (context) => , meta: { cellProps: { colSpan: 2 } } }, { header: t("Tags"), accessorKey: "tags", meta: { cellProps: { hidden: true }, filter: { variant: "select", layout: "react", options: tags } } } // { // Header: i18n("Title"), // accessor: "title", // id: "title", // Cell: (props: any) => , // Filter: DefaultColumnFilter, // colspan: 2 // }, // { // Header: i18n("Tags"), // accessor: "tags", // id: "tags", // hidden: true, // Filter: (props: any) => // tags && tags.length ? ( // // ) : ( // // ) // } ]; return ; }