"use client"; import { Sun, Moon, ChevronDown } from "lucide-react"; import { Icon } from "./ui"; import { user } from "./account-data"; import { useAuth } from "@abe-kap/appshell-sdk/react"; function initialsOf(name: string): string { return name.split(/\s+/).filter(Boolean).slice(0, 2).map((p) => p[0]).join("").toUpperCase(); } export function Topbar({ theme, onToggle, title, subtitle }: { theme: "dark" | "light"; onToggle: () => void; title: string; subtitle: string }) { // When signed in through the Shell, show the real identity from the App Context // Envelope; otherwise fall back to the static demo user. const { user: me } = useAuth(); const name = me?.displayName || user.name; const initials = me ? initialsOf(me.displayName) : user.initials; return (

{title}

{subtitle}

); }