mirror of
https://github.com/CopilotKit/CopilotKit.git
synced 2026-09-14 16:26:20 +08:00
01f5dbd1ee
Northstar AI CRM — a full-featured agentic sales CRM for an enterprise hardware seller, built with CopilotKit, the AG-UI protocol, and a TypeScript Strands agent (@strands-agents/sdk + @ag-ui/aws-strands). The first TypeScript Strands example under examples/. Highlights: - Agentic canvas: tool calls render on the workspace — quote approval opens a quote page; analyze_team and generate_weekly_report open dedicated report pages; frontend tools navigate the workspace. - Generative UI cards, human-in-the-loop follow-up approval, and a live STATE_SNAPSHOT that syncs a SQLite CRM store with the board, dashboard, and report pages. - Dashboard, pipeline (Kanban), products, team, and reports surfaces. Self-contained under examples/showcases/strands-crm with an agent/ + frontend/ split and a concurrently dev script; listed in examples/README.md.
26 lines
793 B
TypeScript
26 lines
793 B
TypeScript
"use client";
|
|
import { BarList } from "@/components/charts";
|
|
import { formatCurrency, teamLeaderboard } from "@/lib/crm";
|
|
import type { CrmState } from "@/lib/crm";
|
|
import { SectionCard } from "./primitives";
|
|
|
|
/**
|
|
* Section 4 — rep leaderboard ranked by bookings (closed-won $); the secondary
|
|
* caption shows quota attainment. Managers carry a 0 quota, so attainment can
|
|
* read 0% for them — that's expected.
|
|
*/
|
|
export function TopReps({ crm }: { crm: CrmState }) {
|
|
const rows = teamLeaderboard(crm);
|
|
const data = rows.map((r) => ({
|
|
label: r.name,
|
|
value: r.bookings,
|
|
secondary: `${Math.round(r.attainment * 100)}% of quota`,
|
|
}));
|
|
|
|
return (
|
|
<SectionCard title="Top reps">
|
|
<BarList data={data} format={(v) => formatCurrency(v)} />
|
|
</SectionCard>
|
|
);
|
|
}
|