import { CheckCircle } from "@phosphor-icons/react"; import type { AgentRecord, GoalRecord } from "@shared/types"; import { EmptyState, ListFrame, ListRow, StatusPill } from "../ui"; import { useT } from "../../i18n"; export function GoalList({ goals, agents, selectedGoalId, onSelect, }: { goals: GoalRecord[]; agents: AgentRecord[]; selectedGoalId: string | null; onSelect: (goalId: string) => void; }) { const t = useT(); if (goals.length === 0) { return ; } return ( {goals.map((goal) => { const isSelected = goal.id === selectedGoalId; const parentGoal = goal.parentId ? goals.find((g) => g.id === goal.parentId) : null; const ownerAgent = goal.ownerAgentId ? agents.find((a) => a.id === goal.ownerAgentId) : null; return ( onSelect(goal.id)} className={`cursor-pointer transition-colors duration-100 ${isSelected ? "bg-[color:var(--accent-soft)]" : "hover:bg-[color:var(--panel-soft)]"}`} >
{isSelected && ( )}
{goal.title}
{goal.description}
{parentGoal && Parent: {parentGoal.title}} {ownerAgent && Owner: {ownerAgent.name}}
); })}
); }