Keep cabinet data private per patient, email new accounts after a request, and store gallery photos as files.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
import { CabinetNav } from "@/components/cabinet/CabinetNav";
|
||||
import { namedPageMetadata } from "@/lib/page-metadata";
|
||||
import { me } from "@/lib/api";
|
||||
import { Link } from "@/i18n/routing";
|
||||
import { getTranslations, setRequestLocale } from "next-intl/server";
|
||||
import type { ReactNode } from "react";
|
||||
|
||||
@@ -22,6 +24,20 @@ export default async function CabinetLayout({
|
||||
const { locale } = await params;
|
||||
setRequestLocale(locale);
|
||||
const t = await getTranslations("cabinet");
|
||||
const auth = await getTranslations("auth");
|
||||
const user = await me();
|
||||
|
||||
if (!user) {
|
||||
return (
|
||||
<div className="mx-auto max-w-xl px-4 py-12 sm:px-6">
|
||||
<h1 className="text-3xl font-bold text-[var(--neutral-900)]">{t("title")}</h1>
|
||||
<p className="mt-4 text-[var(--text-muted)]">{t("loginHint")}</p>
|
||||
<Link href="/login" className="mt-4 inline-block font-semibold text-[var(--brand-700)]">
|
||||
{auth("login")}
|
||||
</Link>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="mx-auto max-w-6xl px-4 py-12 sm:px-6">
|
||||
|
||||
Reference in New Issue
Block a user