Skip to content

Fully autonomous AI Agents system capable of performing complex penetration testing tasks

refactor(frontend): reuse the shared provider-icon map in settings-providers

Sergey Kozyrenko9623e9b77a31
diff --git a/frontend/src/components/icons/provider-icon.tsx b/frontend/src/components/icons/provider-icon.tsx
index c4c8ca33..06a8b767 100644
--- a/frontend/src/components/icons/provider-icon.tsx
+++ b/frontend/src/components/icons/provider-icon.tsx
@@ -29,7 +29,7 @@ interface ProviderIconProps {
tooltip?: string;
}
-const providerIcons: Record<ProviderType, ProviderIconConfig> = {
+export const providerIcons: Record<ProviderType, ProviderIconConfig> = {
[ProviderType.Anthropic]: { className: 'text-purple-500', icon: Anthropic },
[ProviderType.Bedrock]: { className: 'text-blue-500', icon: Bedrock },
[ProviderType.Custom]: { className: 'text-blue-500', icon: Custom },
diff --git a/frontend/src/pages/settings/settings-providers.tsx b/frontend/src/pages/settings/settings-providers.tsx
index a666ad9a..6b38f4f7 100644
--- a/frontend/src/pages/settings/settings-providers.tsx
+++ b/frontend/src/pages/settings/settings-providers.tsx
@@ -7,17 +7,7 @@ import { useNavigate } from 'react-router-dom';
import type { ProviderConfigFragmentFragment } from '@/graphql/types';
-import Anthropic from '@/components/icons/anthropic';
-import Bedrock from '@/components/icons/bedrock';
-import Custom from '@/components/icons/custom';
-import DeepSeek from '@/components/icons/deepseek';
-import Gemini from '@/components/icons/gemini';
-import GLM from '@/components/icons/glm';
-import Kimi from '@/components/icons/kimi';
-import MiniMax from '@/components/icons/minimax';
-import Ollama from '@/components/icons/ollama';
-import OpenAi from '@/components/icons/open-ai';
-import Qwen from '@/components/icons/qwen';
+import { providerIcons } from '@/components/icons/provider-icon';
import ConfirmationDialog from '@/components/shared/confirmation-dialog';
import { Alert, AlertDescription, AlertTitle } from '@/components/ui/alert';
import { Badge } from '@/components/ui/badge';
@@ -38,20 +28,6 @@ import { routes } from '@/lib/routes';
import { formatDate } from '@/lib/utils/format';
type Provider = ProviderConfigFragmentFragment;
-const providerIcons: Record<ProviderType, React.ComponentType<React.SVGProps<SVGSVGElement>>> = {
- [ProviderType.Anthropic]: Anthropic,
- [ProviderType.Bedrock]: Bedrock,
- [ProviderType.Custom]: Custom,
- [ProviderType.Deepseek]: DeepSeek,
- [ProviderType.Gemini]: Gemini,
- [ProviderType.Glm]: GLM,
- [ProviderType.Kimi]: Kimi,
- [ProviderType.Minimax]: MiniMax,
- [ProviderType.Ollama]: Ollama,
- [ProviderType.Openai]: OpenAi,
- [ProviderType.Qwen]: Qwen,
-};
-
// Exhaustive Record so a newly-added ProviderType is a compile error here, not a
// provider silently missing from the create-provider menu.
const providerLabels: Record<ProviderType, string> = {
@@ -145,7 +121,7 @@ function SettingsProviders() {
accessorKey: 'type',
cell: ({ row }) => {
const providerType = row.getValue('type') as ProviderType;
- const Icon = providerIcons[providerType];
+ const Icon = providerIcons[providerType]?.icon;
const label = providerTypes.find((p) => p.type === providerType)?.label || providerType;
return (
@@ -490,7 +466,7 @@ function SettingsProvidersHeader() {
}}
>
{providerTypes.map(({ label, type }) => {
- const Icon = providerIcons[type];
+ const Icon = providerIcons[type]?.icon;
return (
<DropdownMenuItem