diff --git a/AgentCompany-New/src/renderer/src/pages/HomePage.tsx b/AgentCompany-New/src/renderer/src/pages/HomePage.tsx index b629d246..fe08256b 100644 --- a/AgentCompany-New/src/renderer/src/pages/HomePage.tsx +++ b/AgentCompany-New/src/renderer/src/pages/HomePage.tsx @@ -1,76 +1,206 @@ -import { Icon, Pill } from "../shared/ui"; +import { Avatar, Button, Icon, Pill } from "../shared/ui"; +import type { ApprovalRecord, TaskRecord } from "../../../shared/domain"; import type { PageProps } from "./types"; import { activeOrgId, money } from "./types"; -export function HomePage({ snapshot }: PageProps) { +export function HomePage({ snapshot, actions }: PageProps) { const orgId = activeOrgId(snapshot); const organization = snapshot.organizations.find((item) => item.id === orgId); if (!organization) throw new Error("Active organization is missing."); + const employee = snapshot.employees.find((item) => item.orgId === orgId); + if (!employee) throw new Error("Active employee is missing."); const tasks = snapshot.tasks.filter((item) => item.orgId === orgId); const approvals = snapshot.approvals.filter((item) => item.orgId === orgId); const agents = snapshot.agents.filter((item) => item.orgId === orgId); const providers = snapshot.providers.filter((item) => item.orgId === orgId && item.enabled); - const budget = agents.reduce((sum, agent) => sum + agent.budgetCents, 0); + const goals = snapshot.goals.filter((item) => item.orgId === orgId); const pending = approvals.filter((item) => item.state === "pending"); + const inProgress = tasks.filter((item) => item.status === "in_progress"); + const totalBudgetCents = agents.reduce((sum, agent) => sum + agent.budgetCents, 0); + const primaryGoal = goals[0] ?? null; + const greeting = greetingByHour(new Date().getHours()); + const firstName = employee.displayName.split(" ")[0]; return (
{organization.goal}
++ {pending.length} {pending.length === 1 ? "thing" : "things"} waiting on you · {agents.length} {agents.length === 1 ? "agent" : "agents"} on deck +
+