Files
eldov-win/src/components/admin/admin-shell.tsx
T
Jan Wagner ef0f4fbc82 Initial commit: eldov.win portfolio with admin backend
Privates Portfolio von eldov (Jan Wagner). Next.js 16 / React 19 / Tailwind 4 /
SQLite. Eigenes Dark-/Terminal-Theme (Magenta+Grün-Akzente, ASCII-Boxen).

Public Routes (DE default, /en für Englisch):
- /, /ueber-mich, /projekte, /projekte/[slug], /kontakt, /impressum, /datenschutz
- Sitemap, robots, OG, JSON-LD

Admin (HMAC-Single-User, HttpOnly-Cookie):
- /admin/login, /admin/dashboard, /admin/profile, /admin/projects (CRUD)
- API: /api/admin/{login,logout,session,profile,projects,projects/[slug]}

Initial-Seed: Hermes, Casino-Bot, Polymarket-Trader, QuantMuse, Crypto-/Trade-Bot,
TS6-Bot, Freewarez-Landingpage, Minecraft-Portal, OSS-Themes, AI-Subscription-Manager,
LAMP-Link-Themes, Android. KEIN Batchmaker/W-Make (das gehört zu w-make.com).

Stack:
- better-sqlite3 mit Schema-Migration + idempotentem Seed
- HMAC-signiertes Session-Cookie mit timingSafeEqual
- Rate-Limit für /api/admin/login
- Docker + deploy-vps.sh analog w-make-com → free-warez.top
2026-08-31 19:32:17 +02:00

53 lines
1.9 KiB
TypeScript

import Link from "next/link";
import type { Locale } from "@/i18n/routes";
import { getDict } from "@/i18n/dictionaries";
import { LogoutButton } from "./logout-button";
export function AdminShell({
locale,
title,
active,
children,
}: {
locale: Locale;
title: string;
active: "dashboard" | "profile" | "projects" | "newProject" | "editProject";
children: React.ReactNode;
}) {
const dict = getDict(locale);
const items = [
{ id: "dashboard", href: "/admin/dashboard", label: dict.admin.dashboardTitle },
{ id: "profile", href: "/admin/profile", label: dict.admin.profileTitle },
{ id: "projects", href: "/admin/projects", label: dict.admin.projectsTitle },
] as const;
return (
<div className="min-h-screen bg-[var(--bg)] text-[var(--fg)]">
<header className="border-b border-hairline bg-[var(--bg-deep)]">
<div className="mx-auto flex max-w-6xl items-center justify-between px-4 py-3">
<div className="flex items-center gap-4">
<Link href="/admin/dashboard" className="font-mono text-sm">
<span className="text-accent">$</span> eldov<span className="text-muted">.admin</span>
</Link>
<span className="font-mono text-xs text-muted">[{title}]</span>
</div>
<LogoutButton locale={locale} />
</div>
<nav className="mx-auto flex max-w-6xl gap-4 px-4 pb-2">
{items.map((it) => (
<Link
key={it.id}
href={it.href}
className={`border-b-2 px-2 pb-2 font-mono text-xs uppercase ${
active === it.id ? "border-accent text-accent" : "border-transparent text-muted hover:text-[var(--fg)]"
}`}
>
{it.label}
</Link>
))}
</nav>
</header>
<main className="mx-auto max-w-6xl px-4 py-8">{children}</main>
</div>
);
}