import { useEffect } from 'react'; import { useNavigate } from 'react-router-dom'; import { User, ExternalLink, Calendar, Activity, Plus } from 'lucide-react'; import { Button } from '../ui/Button'; import Typography from '../ui/Typography'; import { Card, CardContent, CardHeader, CardTitle } from '../ui/Card'; import { Badge } from '../ui/badge'; import { useHCS10Store, useHCS10Profiles } from '../../stores/hcs10Store'; import { formatDistanceToNow } from 'date-fns'; import { cn } from '../../lib/utils'; interface MyAgentsListProps { className?: string; } interface AgentProfileCardProps { profile: any; onNavigate: () => void; } /** * Component to display a single agent profile card */ const AgentProfileCard: React.FC = ({ profile, onNavigate }) => { return (
{profile.profileImage ? ( {profile.name} ) : (
)}
{profile.name} {profile.status}
{profile.description}
{profile.capabilities.length} capabilities {formatDistanceToNow(profile.registeredAt, { addSuffix: true, })}
{profile.accountId}
); }; /** * Component to display registered HCS-10 agents */ export function MyAgentsList({ className }: MyAgentsListProps) { const navigate = useNavigate(); const { loadProfiles, isLoading, error } = useHCS10Store(); const profiles = useHCS10Profiles(); useEffect(() => { loadProfiles(); }, [loadProfiles]); if (isLoading) { return ( My Agent Profile
); } if (error) { return ( My Agent Profile Failed to load agents: {error} {' '} ); } return (
My Agent Profile
{profiles.length === 0 ? (
No profile registered yet Get started by registering your AI agent profile on the Hedera network
) : ( navigate('/hcs10-profile')} /> )}
); }