fix(provider-list): Modify the keyField function to support index parameters and ensure uniqueness

fix(ai-providers): Optimize configuration synchronization logic in OpenAI editing layout
This commit is contained in:
Supra4E8C
2026-02-12 16:36:44 +08:00
parent e40c3488fe
commit 2d841c0a2f
3 changed files with 16 additions and 10 deletions

View File

@@ -6,7 +6,7 @@ import { EmptyState } from '@/components/ui/EmptyState';
interface ProviderListProps<T> {
items: T[];
loading: boolean;
keyField: (item: T) => string;
keyField: (item: T, index: number) => string;
renderContent: (item: T, index: number) => ReactNode;
onEdit: (index: number) => void;
onDelete: (index: number) => void;
@@ -48,7 +48,7 @@ export function ProviderList<T>({
const rowDisabled = getRowDisabled ? getRowDisabled(item, index) : false;
return (
<div
key={keyField(item)}
key={keyField(item, index)}
className="item-row"
style={rowDisabled ? { opacity: 0.6 } : undefined}
>