mirror of
https://github.com/tiennm99/bsk.git
synced 2026-08-03 18:22:37 +00:00
- responsive app shell: persistent sidebar at md+, accessible off-canvas drawer (focus trap, Esc, dialog semantics) + hamburger below md - active-route highlight, localized role labels, greet by name - visible focus rings, AA-contrast muted text, 44px primary actions - sign-in: autofocus, show/hide password, always-enabled submit - Be Vietnam Pro via next/font; prefers-reduced-motion guard; skip-link
31 lines
890 B
TypeScript
31 lines
890 B
TypeScript
/**
|
|
* AppShell — Server Component.
|
|
*
|
|
* Renders the server-side Sidebar and hands it to AppShellFrame, which owns the
|
|
* responsive chrome (persistent at md+, off-canvas drawer below md). Receives
|
|
* user info from the (app) layout which has already validated session + role.
|
|
*/
|
|
|
|
import type { ReactNode } from "react";
|
|
import type { AppRole } from "@/lib/db/roles";
|
|
import { Sidebar } from "@/components/app-shell/sidebar";
|
|
import { AppShellFrame } from "@/components/app-shell/app-shell-frame";
|
|
|
|
type AppShellProps = {
|
|
email: string;
|
|
fullName: string | null;
|
|
role: AppRole;
|
|
locale: string;
|
|
children: ReactNode;
|
|
};
|
|
|
|
export function AppShell({ email, fullName, role, locale, children }: AppShellProps) {
|
|
return (
|
|
<AppShellFrame
|
|
sidebar={<Sidebar email={email} fullName={fullName} role={role} locale={locale} />}
|
|
>
|
|
{children}
|
|
</AppShellFrame>
|
|
);
|
|
}
|