import { Users } from "lucide-react"; import { useProfileScope } from "@/contexts/useProfileScope"; import { useI18n } from "@/i18n"; import { cn } from "@/lib/utils"; /** * The machine dashboard's single write-target selector. * * Rendered in the sidebar above the nav. Every management page (Config, * Keys, Skills, MCP, Models) reads/writes the selected profile via the * fetchJSON ?profile= injection. Hidden when only one profile exists. */ export function ProfileSwitcher({ collapsed }: { collapsed?: boolean }) { const { profile, currentProfile, profiles, setProfile } = useProfileScope(); const { t } = useI18n(); if (profiles.length < 2) return null; const managed = profile || currentProfile || "default"; const isOther = !!profile && profile !== currentProfile; return (
{collapsed && ( {managed} )}
); }