import AgentImage from '../components/AgentImage'; import { Agent } from './types'; export default function SharedAgentCard({ agent }: { agent: Agent }) { // Check if shared metadata exists and has properties (type is 'any' so we validate it's a non-empty object) const hasSharedMetadata = agent.shared_metadata && typeof agent.shared_metadata === 'object' && agent.shared_metadata !== null && Object.keys(agent.shared_metadata).length > 0; return (

{agent.name}

{agent.description}

{hasSharedMetadata && (
{agent.shared_metadata?.shared_by && (

by {agent.shared_metadata.shared_by}

)} {agent.shared_metadata?.shared_at && (

Shared on{' '} {new Date(agent.shared_metadata.shared_at).toLocaleString( 'en-US', { month: 'long', day: 'numeric', year: 'numeric', hour: '2-digit', minute: '2-digit', hour12: true, }, )}

)}
)} {agent.tool_details && agent.tool_details.length > 0 && (

Connected Tools

{agent.tool_details.map((tool, index) => ( {`${tool.name}{' '} {tool.name} ))}
)}
); }