feat: add template page (#1395)

Add a template page view to allow users to see more details about a
template at a glance.
This commit is contained in:
David Nguyen
2024-11-05 17:36:30 +09:00
committed by GitHub
parent 32b65c4d49
commit 4fa6dc1e21
24 changed files with 1096 additions and 96 deletions

View File

@@ -8,7 +8,7 @@ import { Trans } from '@lingui/macro';
import { Copy, Edit, MoreHorizontal, MoveRight, Share2Icon, Trash2 } from 'lucide-react';
import { useSession } from 'next-auth/react';
import { type FindTemplateRow } from '@documenso/lib/server-only/template/find-templates';
import type { Recipient, Template, TemplateDirectLink } from '@documenso/prisma/client';
import {
DropdownMenu,
DropdownMenuContent,
@@ -23,7 +23,10 @@ import { MoveTemplateDialog } from './move-template-dialog';
import { TemplateDirectLinkDialog } from './template-direct-link-dialog';
export type DataTableActionDropdownProps = {
row: FindTemplateRow;
row: Template & {
directLink?: Pick<TemplateDirectLink, 'token' | 'enabled'> | null;
Recipient: Recipient[];
};
templateRootPath: string;
teamId?: number;
};
@@ -57,7 +60,7 @@ export const DataTableActionDropdown = ({
<DropdownMenuLabel>Action</DropdownMenuLabel>
<DropdownMenuItem disabled={!isOwner && !isTeamTemplate} asChild>
<Link href={`${templateRootPath}/${row.id}`}>
<Link href={`${templateRootPath}/${row.id}/edit`}>
<Edit className="mr-2 h-4 w-4" />
<Trans>Edit</Trans>
</Link>