import { Trans } from '@lingui/react/macro'; import { ChevronLeft } from 'lucide-react'; import { Link, Outlet, isRouteErrorResponse } from 'react-router'; import { useOptionalSession } from '@documenso/lib/client-only/providers/session'; import { cn } from '@documenso/ui/lib/utils'; import { Button } from '@documenso/ui/primitives/button'; import { Header as AuthenticatedHeader } from '~/components/general/app-header'; import { GenericErrorLayout } from '~/components/general/generic-error-layout'; import type { Route } from './+types/_layout'; /** * A layout to handle scenarios where the user is a recipient of a given resource * where we do not care whether they are authenticated or not. * * Such as direct template access, or signing. */ export default function RecipientLayout({ matches }: Route.ComponentProps) { const { sessionData } = useOptionalSession(); // Hide the header for signing routes. const hideHeader = matches.some( (match) => match?.id === 'routes/_recipient+/sign.$token+/_index' || match?.id === 'routes/_recipient+/d.$token+/_index', ); return (