"use client"; /** Distinct A/B/C/D OAuth client tags for same-named YouTube channels. */ const PROFILE_STYLE: Record = { A: "border-sky-400/50 bg-sky-500/25 text-sky-100", B: "border-violet-400/50 bg-violet-500/25 text-violet-100", C: "border-amber-400/50 bg-amber-500/25 text-amber-100", D: "border-rose-400/50 bg-rose-500/25 text-rose-100", }; export function normalizeOauthProfileId(raw?: string | null): string { return String(raw || "").trim().toUpperCase(); } export function OauthClientBadge({ profileId, label, size = "md", className = "", }: { profileId?: string | null; label?: string | null; size?: "sm" | "md" | "lg"; className?: string; }) { const id = normalizeOauthProfileId(profileId); if (!id) { return ( Client — ); } const style = PROFILE_STYLE[id] || "border-teal-400/40 bg-teal-500/20 text-teal-100"; const sizeCls = size === "lg" ? "px-2.5 py-1 text-xs" : size === "sm" ? "px-1.5 py-0 text-[10px]" : "px-2 py-0.5 text-[11px]"; return ( Client {id} ); } export function channelLabelWithProfile(name?: string | null, profileId?: string | null): string { const n = String(name || "").trim() || "未命名"; const id = normalizeOauthProfileId(profileId); return id ? `${n} · Client ${id}` : n; }