import React from 'react'; import { Label } from '@librechat/client'; import type t from 'librechat-data-provider'; import { cn, renderAgentAvatar, getContactDisplayName } from '~/utils'; import { useLocalize } from '~/hooks'; interface AgentCardProps { agent: t.Agent; // The agent data to display onClick: () => void; // Callback when card is clicked className?: string; // Additional CSS classes } /** * Card component to display agent information */ const AgentCard: React.FC = ({ agent, onClick, className = '' }) => { const localize = useLocalize(); return (
{ if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); onClick(); } }} > {/* Two column layout */}
{/* Left column: Avatar and Category */}
{renderAgentAvatar(agent, { size: 'sm' })}
{/* Category tag */}
{agent.category && ( )}
{/* Right column: Name, description, and other content */}
{/* Agent name */} {/* Owner info */} {(() => { const displayName = getContactDisplayName(agent); if (displayName) { return (
); } return null; })()}
{/* Agent description */}

{agent.description || ( )}

); }; export default AgentCard;