import { useTranslation } from "react-i18next"; import { Library, Search, User } from "lucide-react"; import type { FeedFilters, Me } from "../lib/api"; import type { Page } from "../lib/urlState"; import SyncStatus from "./SyncStatus"; // Contextual top bar. Primary navigation + account now live in the left NavSidebar; the // header carries the global sync status, the feed's scope toggle + search (or the current // page title), the language switcher and the notification bell. export default function Header({ me, filters, setFilters, page, onGoToFullHistory, }: { me: Me; filters: FeedFilters; setFilters: (f: FeedFilters) => void; page: Page; onGoToFullHistory: () => void; }) { const { t } = useTranslation(); return (
{page === "feed" && (
{(["my", "all"] as const).map((s) => ( ))}
)} {page === "feed" ? (
setFilters({ ...filters, q: e.target.value })} placeholder={t("header.searchPlaceholder")} className="w-full bg-card border border-border rounded-full pl-9 pr-4 py-2 text-sm outline-none focus:border-accent" />
) : (
{page === "stats" ? t("header.usageStats") : page === "playlists" ? t("header.account.playlists") : page === "settings" ? t("settings.title") : page === "scheduler" ? t("header.scheduler") : page === "config" ? t("header.configuration") : page === "users" ? t("header.users") : page === "notifications" ? t("inbox.navLabel") : page === "messages" ? t("messages.navLabel") : t("header.channelManager")}
)}
); }