@@ -100,7 +97,7 @@ export function PromptCard({
"p-1.5 rounded",
prompt.enabled
? "opacity-30 cursor-not-allowed"
- : "hover:bg-destructive/10 text-destructive"
+ : "hover:bg-destructive/10 text-destructive",
)}
title={prompt.enabled ? "无法删除已启用的提示词" : "删除"}
>
@@ -118,7 +115,9 @@ export function PromptCard({
{prompt.enabled ? (
-
已启用 (同步到配置文件)
+
+ 已启用 (同步到配置文件)
+
) : (
未启用
)}
diff --git a/src/components/prompts/PromptForm.tsx b/src/components/prompts/PromptForm.tsx
index 8c7778c6b..81f8fe3c2 100644
--- a/src/components/prompts/PromptForm.tsx
+++ b/src/components/prompts/PromptForm.tsx
@@ -9,7 +9,12 @@ interface PromptFormProps {
onCancel: () => void;
}
-export function PromptForm({ appType, prompt, onSave, onCancel }: PromptFormProps) {
+export function PromptForm({
+ appType,
+ prompt,
+ onSave,
+ onCancel,
+}: PromptFormProps) {
const [name, setName] = useState(prompt?.name || "");
const [content, setContent] = useState(prompt?.content || "");
const [description, setDescription] = useState(prompt?.description || "");
diff --git a/src/components/prompts/PromptsPage.tsx b/src/components/prompts/PromptsPage.tsx
index cdc4b86b8..5efd78b1b 100644
--- a/src/components/prompts/PromptsPage.tsx
+++ b/src/components/prompts/PromptsPage.tsx
@@ -1,5 +1,12 @@
import { useState, useEffect, useMemo } from "react";
-import { Plus, RefreshCw, Check, Trash2, Download, FileText } from "lucide-react";
+import {
+ Plus,
+ RefreshCw,
+ Check,
+ Trash2,
+ Download,
+ FileText,
+} from "lucide-react";
import { AppType, Prompt } from "@/lib/api/prompts";
import { usePrompts } from "@/hooks/usePrompts";
import { cn } from "@/lib/utils";
@@ -33,13 +40,13 @@ function ToggleSwitch({
className={cn(
"relative inline-flex h-5 w-9 items-center rounded-full transition-colors focus:outline-none focus:ring-2 focus:ring-primary/20",
enabled ? "bg-primary" : "bg-muted-foreground/30",
- disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer"
+ disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer",
)}
>
@@ -148,7 +155,9 @@ export function PromptsPage() {
await importFromFile();
} catch (error) {
console.error("Failed to import:", error);
- alert("导入失败:" + (error instanceof Error ? error.message : String(error)));
+ alert(
+ "导入失败:" + (error instanceof Error ? error.message : String(error)),
+ );
} finally {
setImporting(false);
}
@@ -180,7 +189,7 @@ export function PromptsPage() {
"px-4 py-2 rounded-t-lg text-sm font-medium transition-colors",
activeApp === app.id
? "bg-primary text-primary-foreground"
- : "hover:bg-muted text-muted-foreground"
+ : "hover:bg-muted text-muted-foreground",
)}
>
{app.label}
@@ -190,7 +199,8 @@ export function PromptsPage() {
{/* Status bar */}
- 共 {promptList.length} 个提示词 · {enabledPrompt
+ 共 {promptList.length} 个提示词 ·{" "}
+ {enabledPrompt
? `当前启用: ${enabledPrompt[1].name}`
: "暂无启用的提示词"}
@@ -208,14 +218,18 @@ export function PromptsPage() {
className="p-1.5 rounded hover:bg-muted"
title={`从 ${currentApp.filename} 导入`}
>
-
+