trptk/components/release/BookletLink.tsx
2026-02-24 17:14:07 +01:00

26 lines
583 B
TypeScript

"use client";
import { useAuth } from "@/components/auth/AuthContext";
import { ArrowLink } from "@/components/ArrowLink";
export function BookletLink({ slug }: { slug: string }) {
const { isAuthenticated, isLoading } = useAuth();
if (isLoading) return null;
if (!isAuthenticated) {
return (
<ArrowLink href={`/account/login?redirect=/release/${slug}`}>Log in to download</ArrowLink>
);
}
return (
<ArrowLink
href={`/release/${slug}/booklet`}
target="_blank"
rel="nofollow noopener"
>
Download PDF
</ArrowLink>
);
}