From 71cd1626e04b3683495368af8275d4c2b2036955 Mon Sep 17 00:00:00 2001 From: AdrianoDev Date: Sun, 5 Jul 2026 22:03:07 +0200 Subject: [PATCH] =?UTF-8?q?feat(header):=20identit=C3=A0=20utente=20SSR,?= =?UTF-8?q?=20link=20Accedi=20/=20menu=20utente?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Header.astro | 33 +++++++++++++++++++++++++++++++++ src/layouts/Base.astro | 15 +++++++-------- 2 files changed, 40 insertions(+), 8 deletions(-) diff --git a/src/components/Header.astro b/src/components/Header.astro index 33a0b4c..eeb2cf3 100644 --- a/src/components/Header.astro +++ b/src/components/Header.astro @@ -1,7 +1,15 @@ --- import { site } from '../data/site'; import { t, contentImageUrl } from '../lib/content'; +interface Props { + user: { username: string; role: string } | null; + showTags: boolean; + canTags: boolean; +} +const { user, canTags } = Astro.props; const path = Astro.url.pathname; +const loginHref = `/login?next=${encodeURIComponent(path)}`; +const areaHref = user?.role === 'superuser' ? '/admin/content' : '/admin'; ---