Skip to content

Commit

Permalink
fixed type inference
Browse files Browse the repository at this point in the history
  • Loading branch information
danihengeveld committed Oct 15, 2023
1 parent efa04d4 commit 1421d40
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 13 deletions.
16 changes: 5 additions & 11 deletions src/components/dashboard/shurtles-table/columns.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
import {
createColumnHelper,
type CellContext,
type ColumnDef,
} from "@tanstack/react-table";
import { createColumnHelper, type ColumnDef } from "@tanstack/react-table";

import Link from "next/link";
import { Button } from "~/components/ui/button";
Expand All @@ -11,7 +7,7 @@ import Date from "~/components/utils/date";
import { truncate } from "~/lib/truncate";
import { type RouterOutputs } from "~/utils/api";

export type Shurtle = RouterOutputs["shurtle"]["getAllForUser"][0];
export type Shurtle = RouterOutputs["shurtle"]["get"]["allForUser"][0];

const columnHelper = createColumnHelper<Shurtle>();

Expand All @@ -20,9 +16,7 @@ export const shurtlesTableColumns: ColumnDef<Shurtle>[] = [
header: ({ column }) => (
<DataTableColumnHeader column={column} title="Hits" />
),
cell: (info) => (
<div className="font-semibold">{info.getValue()}</div>
),
cell: (info) => <div className="font-semibold">{info.getValue()}</div>,
}) as ColumnDef<Shurtle>,
columnHelper.accessor("slug", {
header: "Slug",
Expand All @@ -31,8 +25,8 @@ export const shurtlesTableColumns: ColumnDef<Shurtle>[] = [
header: "Url",
cell: (info) => (
<Link href={info.getValue()}>
<Button variant="link" className="p-0 font-normal whitespace-nowrap">
{truncate(info.getValue(), 50)}
<Button variant="link" className="whitespace-nowrap p-0 font-normal">
{truncate(info.getValue(), 50)}
</Button>
</Link>
),
Expand Down
3 changes: 1 addition & 2 deletions src/components/utils/data-table/column-header.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { type Column } from "@tanstack/react-table";
import { ChevronsUpDown, EyeOff, SortAsc, SortDesc } from "lucide-react";
import { ChevronsUpDown, SortAsc, SortDesc } from "lucide-react";

import { Button } from "~/components/ui/button";
import {
DropdownMenu,
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuSeparator,
DropdownMenuTrigger,
} from "~/components/ui/dropdown-menu";
import { cn } from "~/lib/cn";
Expand Down

0 comments on commit 1421d40

Please sign in to comment.