import React from 'react'; import type t from 'librechat-data-provider'; import useLocalize from '~/hooks/useLocalize'; import { renderAgentAvatar, getContactDisplayName } from '~/utils/agents'; import { cn } from '~/utils'; 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(); } }} >
{/* Agent avatar section - left side, responsive */}
{renderAgentAvatar(agent, { size: 'md' })}
{/* Agent info section - right side, responsive */}
{/* Agent name - responsive text sizing */}

{agent.name}

{/* Agent description - responsive text sizing and spacing */}

{agent.description || ( {localize('com_agents_no_description')} )}

{/* Owner info - responsive text sizing */} {(() => { const displayName = getContactDisplayName(agent); if (displayName) { return (
{localize('com_agents_created_by')} {displayName}
); } return null; })()}
); }; export default AgentCard;