mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-08-04 11:43:57 +08:00
Add Codex auth preservation setting
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { KeyRound } from "lucide-react";
|
||||
import type { SettingsFormState } from "@/hooks/useSettings";
|
||||
import { ToggleRow } from "@/components/ui/toggle-row";
|
||||
|
||||
interface CodexAuthSettingsProps {
|
||||
settings: SettingsFormState;
|
||||
onChange: (updates: Partial<SettingsFormState>) => void;
|
||||
}
|
||||
|
||||
export function CodexAuthSettings({
|
||||
settings,
|
||||
onChange,
|
||||
}: CodexAuthSettingsProps) {
|
||||
const { t } = useTranslation();
|
||||
|
||||
return (
|
||||
<section className="space-y-4">
|
||||
<div className="flex items-center gap-2 pb-2 border-b border-border/40">
|
||||
<KeyRound className="h-4 w-4 text-primary" />
|
||||
<h3 className="text-sm font-medium">{t("settings.codexAuth")}</h3>
|
||||
</div>
|
||||
|
||||
<ToggleRow
|
||||
icon={<KeyRound className="h-4 w-4 text-emerald-500" />}
|
||||
title={t("settings.preserveCodexOfficialAuthOnSwitch")}
|
||||
description={t("settings.preserveCodexOfficialAuthOnSwitchDescription")}
|
||||
checked={settings.preserveCodexOfficialAuthOnSwitch ?? true}
|
||||
onCheckedChange={(value) =>
|
||||
onChange({ preserveCodexOfficialAuthOnSwitch: value })
|
||||
}
|
||||
/>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user