import { Inbox } from "lucide-react"; import type { Client } from "../../entities/client/types"; import type { MeResponse, ProfileOption } from "../../shared/api/mockApi"; import { initials } from "../../shared/lib/format"; import { NodeDcProfileMenu, NodeDcSelect } from "../../shared/nodedc-ui"; export function TopBar({ me, clients, profileOptions, activeProfileId, activeClientId, adminOpen, onProfileChange, onClientChange, onToggleAdmin, onOpenShowcase, onOpenProfileSettings, onLogout, brandLinkUrl = "/", }: { me: MeResponse; clients: Client[]; profileOptions: ProfileOption[]; activeProfileId: string; activeClientId: string; adminOpen: boolean; onProfileChange: (userId: string) => void; onClientChange: (clientId: string) => void; onToggleAdmin: () => void; onOpenShowcase: () => void; onOpenProfileSettings: () => void; onLogout?: () => void; brandLinkUrl?: string; }) { const availableClientIds = new Set(me.memberships.map((membership) => membership.clientId)); const availableClients = clients.filter((client) => availableClientIds.has(client.id)); const activeClient = availableClients.find((client) => client.id === activeClientId); const clientOptions = availableClients.map((client) => ({ value: client.id, label: client.name, description: client.legalName ?? undefined, })); return (
NODE DC
onClientChange(clientId)} trigger={({ open, toggle, setTriggerRef }) => ( )} />
(
{ if (event.key === "Enter" || event.key === " ") { event.preventDefault(); toggle(); } }} > Профиль
)} />
); }