"use client"; import { useState, useEffect, useRef } from "react"; const AGENT_CONFIG: Record = { horus: { name: "Horus", avatar: "πŸ‘οΈ", color: "#ff7bc0", role: "Master Orchestrator", description: "Command center, delegates tasks, manages all agents", skills: ["Task delegation", "System orchestration", "Strategic planning"], project: "horus" }, thoth: { name: "Thoth", avatar: "🧠", color: "#8b5cf6", role: "Strategy & Research", description: "SiteMente planning, research, analysis", skills: ["Market research", "Competitor analysis", "AI trends", "Lead research"], project: "sitemente" }, "thoth-trading": { name: "Thoth Trading", avatar: "πŸ“ˆ", color: "#f59e0b", role: "Market Research", description: "Crypto market analysis and research", skills: ["Technical analysis", "Price alerts", "Portfolio tracking"], project: "trading" }, ptah: { name: "Ptah", avatar: "πŸ—οΈ", color: "#10b981", role: "Dev & Ops", description: "Development, deployment, technical implementation", skills: ["Code review", "Deployments", "Infra management", "Bug fixes"], project: "infrastructure" }, seshat: { name: "Seshat", avatar: "πŸ“œ", color: "#ec4899", role: "Content & SEO", description: "Content strategy, SEO, marketing copy", skills: ["SEO optimization", "Copywriting", "Blog posts", "Social media"], project: "sitemente" }, anubis: { name: "Anubis", avatar: "🐺", color: "#6366f1", role: "Outreach & Growth", description: "Lead generation, client acquisition", skills: ["Lead research", "Cold outreach", "Follow-ups", "Deal closing"], project: "sitemente" }, sekhmet: { name: "Sekhmet", avatar: "βš”οΈ", color: "#ef4444", role: "Risk Management", description: "Trade execution and risk", skills: ["Risk assessment", "Trade execution", "Stop-loss management"], project: "trading" }, }; interface TaskModalProps { agentId: string; task?: any; onClose: () => void; onSave: (task: any) => void; } function TaskModal({ agentId, task, onClose, onSave }: TaskModalProps) { const agent = AGENT_CONFIG[agentId]; const [title, setTitle] = useState(task?.title || ""); const [description, setDescription] = useState(task?.description || ""); const [priority, setPriority] = useState(task?.priority || "medium"); const [isRecurring, setIsRecurring] = useState(false); const [scheduleType, setScheduleType] = useState<"hourly" | "daily" | "weekly" | "monthly">("daily"); const [scheduleTime, setScheduleTime] = useState("09:00"); const [scheduleDay, setScheduleDay] = useState(1); const handleSave = () => { if (!title.trim()) return; const newTask = { id: task?.id || `task-${Date.now()}`, title, description, priority, assignee: agentId, project: agent?.project || "sitemente", status: "todo", order: Date.now(), ...(isRecurring && { recurring: { enabled: true, type: scheduleType, time: scheduleType !== "hourly" ? scheduleTime : undefined, dayOfWeek: scheduleType === "weekly" ? scheduleDay : undefined, dayOfMonth: scheduleType === "monthly" ? scheduleDay : undefined, } }) }; onSave(newTask); onClose(); }; return (

{task ? "Edit Task" : "Add New Task"}

setTitle(e.target.value)} placeholder="What needs to be done?" className="w-full mt-1 bg-white/10 border border-white/20 rounded-lg px-3 py-2 text-sm" autoFocus />