Skip to content

Commit

Permalink
chore: move into datagrids folder
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael-Liendo committed Aug 16, 2024
1 parent e5dba4d commit e01eb8b
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<z.infer<typeof LinkSchema>>[] = [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<TData, TValue>
extends React.HTMLAttributes<HTMLDivElement> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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<TData, TValue> {
column?: Column<TData, TValue>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<TData> {
table: Table<TData>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<TData> {
table: Table<TData>;
Expand All @@ -32,7 +29,9 @@ export function DataTableToolbar<TData>({
}
className="h-8 w-[150px] lg:w-[250px]"
/>
{/* {table.getColumn('shorter_name') && (
{/*
todo: for enums of data
{table.getColumn('shorter_name') && (
<DataTableFacetedFilter
column={table.getColumn('shorter_name')}
title="shorter_name"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ import { DropdownMenuTrigger } from '@radix-ui/react-dropdown-menu';
import { MixerHorizontalIcon } from '@radix-ui/react-icons';
import type { Table } from '@tanstack/react-table';

import { Button } from './ui/button';
import { Button } from '../../ui/button';
import {
DropdownMenu,
DropdownMenuCheckboxItem,
DropdownMenuContent,
DropdownMenuLabel,
DropdownMenuSeparator,
} from './ui/dropdown-menu';
} from '../../ui/dropdown-menu';

interface DataTableViewOptionsProps<TData> {
table: Table<TData>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<TData, TValue> {
columns: ColumnDef<TData, TValue>[];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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<TData> {
row: Row<TData>;
Expand Down
4 changes: 2 additions & 2 deletions client/src/pages/(app)/Home.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down

0 comments on commit e01eb8b

Please sign in to comment.