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,3 +1,5 @@
|
||||
import { getMyDocuments } from "@/lib/api";
|
||||
import { formatDate } from "@/lib/utils";
|
||||
import { getTranslations, setRequestLocale } from "next-intl/server";
|
||||
|
||||
export default async function CabinetDocumentsPage({
|
||||
@@ -8,11 +10,27 @@ export default async function CabinetDocumentsPage({
|
||||
const { locale } = await params;
|
||||
setRequestLocale(locale);
|
||||
const t = await getTranslations("cabinet");
|
||||
const documents = await getMyDocuments();
|
||||
|
||||
return (
|
||||
<div>
|
||||
<h2 className="mb-4 text-xl font-semibold">{t("documents")}</h2>
|
||||
<p className="text-[var(--text-muted)]">{t("emptyDocuments")}</p>
|
||||
{documents.length === 0 ? (
|
||||
<p className="text-[var(--text-muted)]">{t("emptyDocuments")}</p>
|
||||
) : (
|
||||
<ul className="space-y-3">
|
||||
{documents.map((doc) => (
|
||||
<li key={doc.id} className="rounded-[12px] border border-[var(--border)] bg-white px-4 py-3">
|
||||
<a href={doc.href} className="font-semibold text-[var(--brand-700)]" target="_blank" rel="noreferrer">
|
||||
{doc.title}
|
||||
</a>
|
||||
{doc.issuedAt ? (
|
||||
<p className="mt-1 text-sm text-[var(--text-muted)]">{formatDate(doc.issuedAt, locale)}</p>
|
||||
) : null}
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user