Files
CC-Switch/src/components/settings/AuthCenterPanel.tsx
T
Jason 5288238694 refactor: tighten OAuth Auth Center copy, layout, and icon
- Trim Auth Center section descriptions to focus on user intent
- Remove duplicate outer heading on the auth settings tab
- Swap Sparkles glyph for CodexIcon on the ChatGPT card
- Generalize codexOauth.authStatus to a neutral "Auth status"
- Register settings.authCenter.* keys across zh/en/ja locales
2026-04-09 16:49:13 +08:00

75 lines
2.7 KiB
TypeScript

import { Github, ShieldCheck } from "lucide-react";
import { useTranslation } from "react-i18next";
import { Badge } from "@/components/ui/badge";
import { CodexIcon } from "@/components/BrandIcons";
import { CopilotAuthSection } from "@/components/providers/forms/CopilotAuthSection";
import { CodexOAuthSection } from "@/components/providers/forms/CodexOAuthSection";
export function AuthCenterPanel() {
const { t } = useTranslation();
return (
<div className="space-y-6">
<section className="rounded-xl border border-border/60 bg-card/60 p-6">
<div className="flex items-start justify-between gap-4">
<div className="space-y-2">
<div className="flex items-center gap-2">
<ShieldCheck className="h-5 w-5 text-primary" />
<h3 className="text-base font-semibold">
{t("settings.authCenter.title", {
defaultValue: "OAuth 认证中心",
})}
</h3>
</div>
<p className="text-sm text-muted-foreground">
{t("settings.authCenter.description", {
defaultValue:
"在 Claude Code 中使用您的其他订阅,请注意合规风险。",
})}
</p>
</div>
<Badge variant="secondary">
{t("settings.authCenter.beta", { defaultValue: "Beta" })}
</Badge>
</div>
</section>
<section className="rounded-xl border border-border/60 bg-card/60 p-6">
<div className="mb-4 flex items-center gap-3">
<div className="flex h-10 w-10 items-center justify-center rounded-xl bg-muted">
<Github className="h-5 w-5" />
</div>
<div>
<h4 className="font-medium">GitHub Copilot</h4>
<p className="text-sm text-muted-foreground">
{t("settings.authCenter.copilotDescription", {
defaultValue: "管理 GitHub Copilot 账号",
})}
</p>
</div>
</div>
<CopilotAuthSection />
</section>
<section className="rounded-xl border border-border/60 bg-card/60 p-6">
<div className="mb-4 flex items-center gap-3">
<div className="flex h-10 w-10 items-center justify-center rounded-xl bg-muted">
<CodexIcon size={20} />
</div>
<div>
<h4 className="font-medium">ChatGPT (Codex OAuth)</h4>
<p className="text-sm text-muted-foreground">
{t("settings.authCenter.codexOauthDescription", {
defaultValue: "管理 ChatGPT 账号",
})}
</p>
</div>
</div>
<CodexOAuthSection />
</section>
</div>
);
}