"use client"; import Link from "next/link"; import { Bot, Crown, Users, Shield, Sparkles } from "lucide-react"; import { MicrodaoAgent } from "@/hooks/useMicrodao"; interface MicrodaoAgentsSectionProps { agents: MicrodaoAgent[]; microdaoSlug?: string; } const ROLE_META: Record = { orchestrator: { label: "Orchestrator", chipClass: "bg-fuchsia-500/10 text-fuchsia-300 border-fuchsia-500/30", icon: , }, district_lead: { label: "District Lead", chipClass: "bg-purple-500/10 text-purple-300 border-purple-500/30", icon: , }, core_team: { label: "Core Team", chipClass: "bg-indigo-500/10 text-indigo-300 border-indigo-500/30", icon: , }, member: { label: "Member", chipClass: "bg-slate-500/10 text-slate-300 border-slate-500/30", icon: , }, guardian: { label: "Guardian", chipClass: "bg-rose-500/10 text-rose-300 border-rose-500/30", icon: , }, steward: { label: "Steward", chipClass: "bg-emerald-500/10 text-emerald-300 border-emerald-500/30", icon: , }, }; const STATUS_COLORS: Record = { active: "bg-emerald-400", inactive: "bg-slate-500", suspended: "bg-yellow-400", offline: "bg-slate-600", }; export function MicrodaoAgentsSection({ agents, microdaoSlug }: MicrodaoAgentsSectionProps) { if (!agents || agents.length === 0) { return (

Агенти MicroDAO

Для цього MicroDAO ще не призначені агенти.

); } // Group agents by role const orchestrators = agents.filter(a => a.role === "orchestrator" || a.role === "district_lead"); const coreTeam = agents.filter(a => a.role === "core_team" || a.is_core); const others = agents.filter(a => !orchestrators.includes(a) && !coreTeam.includes(a)); return (

Агенти MicroDAO ({agents.length})

{/* Orchestrator(s) */} {orchestrators.length > 0 && (
Orchestrator
{orchestrators.map(agent => ( ))}
)} {/* Core Team */} {coreTeam.length > 0 && (
Core Team
{coreTeam.map(agent => ( ))}
)} {/* Other Members */} {others.length > 0 && (
Members
{others.map(agent => ( ))}
)}
); } interface AgentCardProps { agent: MicrodaoAgent; featured?: boolean; compact?: boolean; } function AgentCard({ agent, featured = false, compact = false }: AgentCardProps) { const roleMeta = ROLE_META[agent.role] || ROLE_META.member; const statusColor = STATUS_COLORS[agent.status] || STATUS_COLORS.offline; if (compact) { return (
{agent.avatar_url ? ( {agent.name} ) : ( )}
{agent.name}
); } return (
{/* Avatar */}
{agent.avatar_url ? ( {agent.name} ) : ( )}
{/* Info */}
{agent.name} {agent.is_core && ( Core )}
{/* Role badge */}
{roleMeta.icon} {roleMeta.label}
{/* Kind and Gov Level */} {(agent.kind || agent.gov_level) && (
{agent.kind && {agent.kind}} {agent.kind && agent.gov_level && } {agent.gov_level && {agent.gov_level}}
)}
); }