Skip to content

Commit

Permalink
DEAR-125: fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
baurnick committed Jul 19, 2024
1 parent e26c924 commit 6b20b2f
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 14 deletions.
4 changes: 2 additions & 2 deletions app/(main)/team/components/TeamTable/TeamTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@
import TeamTableToolbar from './TeamTableToolbar';

interface TeamTableProps<TData> {
columns?: ColumnDef<TData>[];
data?: TData[];
columns: ColumnDef<TData>[];
data: TData[];
}

const TeamTable = <TData,>({ columns, data }: TeamTableProps<TData>) => {
Expand Down
13 changes: 4 additions & 9 deletions app/(main)/team/components/TeamTable/columns.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,10 @@ import {
} from '@components/ui/DropdownMenu/Dropdown-menu';
import { ChevronRight, Ellipsis } from 'lucide-react';
import { Button } from '@components/ui/Buttons/Button';
import { Team } from '@/types/TeamType';

export type TeamType = {
id: string;
name: string;
createdAt: string;
role: 'ADMIN' | 'MEMBER';
};

export const columns: ColumnDef<TeamType>[] = [
export const columns: ColumnDef<Team>[] = [
{
accessorKey: 'id',
header: '',
Expand All @@ -37,8 +32,8 @@ export const columns: ColumnDef<TeamType>[] = [
header: ({ column }) => <DataTableColumnHeader column={column} title="Created" />,
cell: ({ row }) => {
const date = new Date(row.original.createdAt);
return <span>{format(date, 'yyyy-MM-dd')}</span>
}
return <span>{format(date, 'yyyy-MM-dd')}</span>;
},
},
{
accessorKey: 'role',
Expand Down
4 changes: 2 additions & 2 deletions app/(main)/team/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Loading from '@components/Loading/Loading';
import Error from '@components/Error/Error';
import useSWRClient from '@hooks/useSWRClient';
import { Team } from '@/types/TeamType';
import { columns, TeamType } from './components/TeamTable/columns';
import { columns } from './components/TeamTable/columns';
import TeamTable from './components/TeamTable/TeamTable';

const TeamPage: React.FC = () => {
Expand All @@ -22,7 +22,7 @@ const TeamPage: React.FC = () => {
<div>
{data ? (
<div className="space-y-4">
<TeamTable<TeamType> columns={columns} data={data} />
<TeamTable<Team> columns={columns} data={data} />
</div>
) : (
<Loading />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ const CreateTeamDialog: React.FC = () => {
</div>
<DialogFooter>
<Link href="/team">
<Button className="mt-8 px-8">Continue</Button>
<Button className="mt-8 px-8">Continue</Button>
</Link>
</DialogFooter>
</>
Expand Down
1 change: 1 addition & 0 deletions types/TeamType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export interface Team {
createdBy: number;
createdAt: string;
active: boolean;
role: string;
}

export interface CreateTeamDTO {
Expand Down

0 comments on commit 6b20b2f

Please sign in to comment.