feat(universal-provider): add duplicate action for universal providers (#2416)

Signed-off-by: Hu Butui <hot123tea123@gmail.com>
This commit is contained in:
Butui Hu
2026-05-02 21:36:07 +08:00
committed by GitHub
parent ddc7b4567e
commit 1d44b1ba41
5 changed files with 52 additions and 1 deletions
@@ -1,5 +1,5 @@
import { useTranslation } from "react-i18next";
import { Edit2, Trash2, RefreshCw, Globe } from "lucide-react";
import { Edit2, Trash2, RefreshCw, Globe, Copy } from "lucide-react";
import { Button } from "@/components/ui/button";
import { ProviderIcon } from "@/components/ProviderIcon";
import type { UniversalProvider } from "@/types";
@@ -9,6 +9,7 @@ interface UniversalProviderCardProps {
onEdit: (provider: UniversalProvider) => void;
onDelete: (id: string) => void;
onSync: (id: string) => void;
onDuplicate: (provider: UniversalProvider) => void;
}
export function UniversalProviderCard({
@@ -16,6 +17,7 @@ export function UniversalProviderCard({
onEdit,
onDelete,
onSync,
onDuplicate,
}: UniversalProviderCardProps) {
const { t } = useTranslation();
@@ -53,6 +55,15 @@ export function UniversalProviderCard({
>
<RefreshCw className="h-4 w-4" />
</Button>
<Button
variant="ghost"
size="icon"
className="h-8 w-8"
onClick={() => onDuplicate(provider)}
title={t("universalProvider.duplicate", { defaultValue: "复制" })}
>
<Copy className="h-4 w-4" />
</Button>
<Button
variant="ghost"
size="icon"