Merge pull request #1440 from escapade-mckv/agent-icons

agents use icons and bg color
This commit is contained in:
Bobbie 2025-08-24 20:49:30 +05:30 committed by GitHub
commit e4189c74a3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 7 additions and 12 deletions

View File

@ -69,7 +69,6 @@ export const AgentPreview = ({ agent, agentMetadata }: AgentPreviewProps) => {
return <KortixLogo size={16} />;
}
if (agent.icon_name) {
const DynamicIcon = require('lucide-react/dynamic').DynamicIcon;
return (
<div
className="h-4 w-4 flex items-center justify-center rounded-sm"

View File

@ -9,6 +9,7 @@ import { useCreateTemplate, useUnpublishTemplate } from '@/hooks/react-query/sec
import { toast } from 'sonner';
import { AgentCard } from './custom-agents-page/agent-card';
import { KortixLogo } from '../sidebar/kortix-logo';
import { DynamicIcon } from 'lucide-react/dynamic';
interface Agent {
agent_id: string;
@ -107,16 +108,11 @@ const AgentModal: React.FC<AgentModalProps> = ({
className="h-16 w-16 rounded-xl flex items-center justify-center"
style={{ backgroundColor: agent.icon_background || '#F3F4F6' }}
>
{(() => {
const DynamicIcon = require('lucide-react/dynamic').DynamicIcon;
return (
<DynamicIcon
name={agent.icon_name as any}
size={32}
color={agent.icon_color || '#000000'}
/>
);
})()}
<DynamicIcon
name={agent.icon_name as any}
size={32}
color={agent.icon_color || '#000000'}
/>
</div>
) : agent.profile_image_url ? (
<img src={agent.profile_image_url} alt={agent.name} className="h-16 w-16 rounded-xl object-cover" />

View File

@ -2,6 +2,7 @@
import React from 'react';
import { Download, CheckCircle, Loader2, Globe, GlobeLock, GitBranch, Trash2, MoreVertical, User } from 'lucide-react';
import { DynamicIcon } from 'lucide-react/dynamic';
import { Badge } from '@/components/ui/badge';
import { Button } from '@/components/ui/button';
import {
@ -362,7 +363,6 @@ const CardAvatar: React.FC<{
}
if (iconName) {
const DynamicIcon = require('lucide-react/dynamic').DynamicIcon;
return (
<div
className="h-14 w-14 flex items-center justify-center rounded-2xl"