mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-08-02 10:21:16 +08:00
feat(common-config): add guide info and empty state to common config editor
Add an informational alert block at the top of the common config snippet editor modal (Claude/Codex/Gemini) explaining what the feature is, why it exists, and how to use it. Also add an empty state prompt when no snippet has been extracted yet, guiding users to click "Extract from Editor". Includes i18n support for zh/en/ja.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import React, { useEffect, useState } from "react";
|
||||
import { Save, Download, Loader2 } from "lucide-react";
|
||||
import { Save, Download, Loader2, Package } from "lucide-react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { FullScreenPanel } from "@/components/common/FullScreenPanel";
|
||||
import { Button } from "@/components/ui/button";
|
||||
@@ -100,9 +100,35 @@ export const CodexCommonConfigModal: React.FC<CodexCommonConfigModalProps> = ({
|
||||
}
|
||||
>
|
||||
<div className="space-y-4">
|
||||
<p className="text-sm text-muted-foreground">
|
||||
<div className="rounded-lg border border-blue-200 dark:border-blue-800 bg-blue-50/50 dark:bg-blue-950/30 p-3 space-y-1.5">
|
||||
<p className="text-sm font-medium text-blue-800 dark:text-blue-300">
|
||||
{t("commonConfig.guideTitle")}
|
||||
</p>
|
||||
<p className="text-xs text-blue-700/80 dark:text-blue-400/80">
|
||||
{t("commonConfig.guidePurpose")}
|
||||
</p>
|
||||
<p className="text-xs text-blue-700/80 dark:text-blue-400/80">
|
||||
{t("commonConfig.guideUsage")}
|
||||
</p>
|
||||
<p className="text-xs text-blue-700/80 dark:text-blue-400/80">
|
||||
{t("commonConfig.guideReExtract")}
|
||||
</p>
|
||||
<p className="text-xs text-muted-foreground">
|
||||
{t("commonConfig.guideReassurance")}
|
||||
</p>
|
||||
</div>
|
||||
<p className="text-xs text-muted-foreground">
|
||||
{t("codexConfig.commonConfigHint")}
|
||||
</p>
|
||||
{(!draftValue || draftValue.trim() === "") && (
|
||||
<div className="flex flex-col items-center justify-center py-6 text-center text-muted-foreground">
|
||||
<Package className="h-8 w-8 mb-2 opacity-40" />
|
||||
<p className="text-sm font-medium">
|
||||
{t("commonConfig.emptyTitle")}
|
||||
</p>
|
||||
<p className="text-xs mt-1">{t("commonConfig.emptyHint")}</p>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<JsonEditor
|
||||
value={draftValue}
|
||||
|
||||
Reference in New Issue
Block a user