diff --git a/client/src/components/links-columns.tsx b/client/src/components/datagrids/links/links-columns.tsx similarity index 89% rename from client/src/components/links-columns.tsx rename to client/src/components/datagrids/links/links-columns.tsx index b7ae184..0c84fe1 100644 --- a/client/src/components/links-columns.tsx +++ b/client/src/components/datagrids/links/links-columns.tsx @@ -2,11 +2,11 @@ import type { LinkSchema } from '@linx/shared'; import type { ColumnDef } from '@tanstack/react-table'; import type { z } from 'zod'; -import { statuses } from '../data/links'; -import { DataTableColumnHeader } from './data-table-column-header'; -import { DataTableRowActions } from './data-table-row-actions'; -import { Badge } from './ui/badge'; -import { Checkbox } from './ui/checkbox'; +import { statuses } from '../../../data/links'; +import { Badge } from '../../ui/badge'; +import { Checkbox } from '../../ui/checkbox'; +import { DataTableColumnHeader } from './links-table-column-header'; +import { DataTableRowActions } from './linkx-table-row-actions'; export const linksColumns: ColumnDef>[] = [ { diff --git a/client/src/components/data-table-column-header.tsx b/client/src/components/datagrids/links/links-table-column-header.tsx similarity index 96% rename from client/src/components/data-table-column-header.tsx rename to client/src/components/datagrids/links/links-table-column-header.tsx index 8aa4f9f..3ac0c3e 100644 --- a/client/src/components/data-table-column-header.tsx +++ b/client/src/components/datagrids/links/links-table-column-header.tsx @@ -7,14 +7,14 @@ import { import type { Column } from '@tanstack/react-table'; import { cn } from '@/lib/utils'; -import { Button } from './ui/button'; +import { Button } from '../../ui/button'; import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger, -} from './ui/dropdown-menu'; +} from '../../ui/dropdown-menu'; interface DataTableColumnHeaderProps extends React.HTMLAttributes { diff --git a/client/src/components/data-table-faceted-filter.tsx b/client/src/components/datagrids/links/links-table-faceted-filter.tsx similarity index 95% rename from client/src/components/data-table-faceted-filter.tsx rename to client/src/components/datagrids/links/links-table-faceted-filter.tsx index e714abf..54d1de4 100644 --- a/client/src/components/data-table-faceted-filter.tsx +++ b/client/src/components/datagrids/links/links-table-faceted-filter.tsx @@ -3,8 +3,8 @@ import type { Column } from '@tanstack/react-table'; import type * as React from 'react'; import { cn } from '@/lib/utils'; -import { Badge } from './ui/badge'; -import { Button } from './ui/button'; +import { Badge } from '../../ui/badge'; +import { Button } from '../../ui/button'; import { Command, CommandEmpty, @@ -13,9 +13,9 @@ import { CommandItem, CommandList, CommandSeparator, -} from './ui/command'; -import { Popover, PopoverContent, PopoverTrigger } from './ui/popover'; -import { Separator } from './ui/separator'; +} from '../../ui/command'; +import { Popover, PopoverContent, PopoverTrigger } from '../../ui/popover'; +import { Separator } from '../../ui/separator'; interface DataTableFacetedFilterProps { column?: Column; diff --git a/client/src/components/data-table-pagination.tsx b/client/src/components/datagrids/links/links-table-pagination.tsx similarity index 97% rename from client/src/components/data-table-pagination.tsx rename to client/src/components/datagrids/links/links-table-pagination.tsx index e4850e1..4315274 100644 --- a/client/src/components/data-table-pagination.tsx +++ b/client/src/components/datagrids/links/links-table-pagination.tsx @@ -6,14 +6,14 @@ import { } from '@radix-ui/react-icons'; import type { Table } from '@tanstack/react-table'; -import { Button } from './ui/button'; +import { Button } from '../../ui/button'; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, -} from './ui/select'; +} from '../../ui/select'; interface DataTablePaginationProps { table: Table; diff --git a/client/src/components/data-table-toolbar.tsx b/client/src/components/datagrids/links/links-table-toolbar.tsx similarity index 81% rename from client/src/components/data-table-toolbar.tsx rename to client/src/components/datagrids/links/links-table-toolbar.tsx index 37ae485..344c571 100644 --- a/client/src/components/data-table-toolbar.tsx +++ b/client/src/components/datagrids/links/links-table-toolbar.tsx @@ -3,12 +3,9 @@ import { Cross2Icon } from '@radix-ui/react-icons'; import type { Table } from '@tanstack/react-table'; -import { DataTableViewOptions } from './data-table-view-options'; -import { Button } from './ui/button'; -import { Input } from './ui/input'; - -import { priorities, statuses } from '../data/links'; -import { DataTableFacetedFilter } from './data-table-faceted-filter'; +import { Button } from '../../ui/button'; +import { Input } from '../../ui/input'; +import { DataTableViewOptions } from './links-table-view-options'; interface DataTableToolbarProps { table: Table; @@ -32,7 +29,9 @@ export function DataTableToolbar({ } className="h-8 w-[150px] lg:w-[250px]" /> - {/* {table.getColumn('shorter_name') && ( + {/* + todo: for enums of data + {table.getColumn('shorter_name') && ( { table: Table; diff --git a/client/src/components/data-table.tsx b/client/src/components/datagrids/links/links-table.tsx similarity index 95% rename from client/src/components/data-table.tsx rename to client/src/components/datagrids/links/links-table.tsx index 7e7c696..5acec2c 100644 --- a/client/src/components/data-table.tsx +++ b/client/src/components/datagrids/links/links-table.tsx @@ -23,10 +23,10 @@ import { TableHead, TableHeader, TableRow, -} from './ui/table'; +} from '../../ui/table'; -import { DataTablePagination } from './data-table-pagination'; -import { DataTableToolbar } from './data-table-toolbar'; +import { DataTablePagination } from './links-table-pagination'; +import { DataTableToolbar } from './links-table-toolbar'; interface DataTableProps { columns: ColumnDef[]; diff --git a/client/src/components/data-table-row-actions.tsx b/client/src/components/datagrids/links/linkx-table-row-actions.tsx similarity index 94% rename from client/src/components/data-table-row-actions.tsx rename to client/src/components/datagrids/links/linkx-table-row-actions.tsx index 3a3b538..6f9744e 100644 --- a/client/src/components/data-table-row-actions.tsx +++ b/client/src/components/datagrids/links/linkx-table-row-actions.tsx @@ -3,7 +3,7 @@ import { DotsHorizontalIcon } from '@radix-ui/react-icons'; import type { Row } from '@tanstack/react-table'; -import { Button } from './ui/button'; +import { Button } from '../../ui/button'; import { DropdownMenu, DropdownMenuContent, @@ -16,10 +16,10 @@ import { DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, -} from './ui/dropdown-menu'; +} from '../../ui/dropdown-menu'; import { LinkSchema } from '@linx/shared'; -import { labels } from '../data/links'; +import { labels } from '../../../data/links'; interface DataTableRowActionsProps { row: Row; diff --git a/client/src/pages/(app)/Home.tsx b/client/src/pages/(app)/Home.tsx index c95f41e..4bb4006 100644 --- a/client/src/pages/(app)/Home.tsx +++ b/client/src/pages/(app)/Home.tsx @@ -1,5 +1,5 @@ -import { DataTable } from '@/components/data-table'; -import { linksColumns } from '@/components/links-columns'; +import { linksColumns } from '@/components/datagrids/links/links-columns'; +import { DataTable } from '@/components/datagrids/links/links-table'; import { MainNav } from '@/components/main-nav'; import { UserNav } from '@/components/user-nav'; import { LinkSchema } from '@linx/shared';