Skip to content

Commit

Permalink
fix(ShortUrls): add cut off url and add tooltip
Browse files Browse the repository at this point in the history
  • Loading branch information
ijsKoud committed Sep 13, 2023
1 parent 35437f4 commit 003b29b
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion apps/web/src/app/dashboard/shorturls/_table/columns.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { useToast } from "@paperplane/ui/use-toast";
import { ToastAction } from "@paperplane/ui/toast";
import { UpdateDialog } from "../UpdateDialog";
import { useState } from "react";
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@paperplane/ui/tooltip";

export const columns: ColumnDef<ApiUrl>[] = [
{
Expand All @@ -43,7 +44,23 @@ export const columns: ColumnDef<ApiUrl>[] = [
},
{
accessorKey: "redirect",
header: "URL"
header: "URL",
cell: ({ row }) => {
const url = row.getValue("redirect") as string;
return (
<TooltipProvider>
<Tooltip>
<TooltipTrigger asChild>
<p className="overflow-hidden text-ellipsis max-w-xs whitespace-nowrap">{url}</p>
</TooltipTrigger>

<TooltipContent>
<p className="max-w-[calc(100vh-32px)]">{url}</p>
</TooltipContent>
</Tooltip>
</TooltipProvider>
);
}
},
{
accessorKey: "visible",
Expand Down

0 comments on commit 003b29b

Please sign in to comment.