import Head from "next/head"; import Link from "next/link"; import { useRouter } from "next/router"; import prisma from "@documenso/prisma"; import { Button, IconButton } from "@documenso/ui"; import { NextPageWithLayout } from "../../_app"; import { ArrowDownTrayIcon, CheckBadgeIcon } from "@heroicons/react/24/outline"; const Signed: NextPageWithLayout = (props: any) => { const router = useRouter(); const allRecipientsSigned = props.document.Recipient?.every( (r: any) => r.signingStatus === "SIGNED" ); return ( <>
You signed "{props.document.title}"
You will be notfied when all recipients have signed.
All recipients signed.
Want to send slick signing links like this one?{" "} Hosted Documenso is coming soon™
> ); }; export async function getServerSideProps(context: any) { const recipientToken: string = context.query["token"]; const recipient = await prisma.recipient.findFirstOrThrow({ where: { token: recipientToken, }, include: { Document: { include: { Recipient: true } }, }, }); const fields = await prisma.field.findMany({ where: { documentId: recipient.Document.id, }, include: { Recipient: true, }, }); return { props: { document: JSON.parse(JSON.stringify(recipient.Document)), fields: JSON.parse(JSON.stringify(fields)), recipient: JSON.parse(JSON.stringify(recipient)), }, }; } export default Signed;