Skip to content
4 min read · 799 words

Components

Seven components in four folders: layout chrome, dashboard widgets, the agent card, and the create-agent form. All are server components except CreateAgentForm.

components/layout/

Fixed 260px left rail (hidden below md). Renders the brand block ("AgentOps AI — Enterprise Agent Platform"), three nav sections, and a Settings footer link.

PropTypeDefaultPurpose
activeItemstring"Dashboard"Which link gets the active treatment (left border + filled icon via fontVariationSettings: "'FILL' 1")

Nav data is defined in-file as NavItem[] arrays: main (/dashboard, /agents, /create-agent — real links) plus Workflows and Operations sections whose items are href="#" placeholders awaiting their pages (Known Issues).

Topbar

Fixed 64px header offset for the sidebar width (md:w-[calc(100%-260px)]), with a backdrop-blur translucent surface. Contains a (non-functional) search input, optional agent-name label, Help/Notifications icon buttons, an environment chip ("Dev"), a "New Agent" CTA linking to /create-agent, and an "AO" avatar.

PropTypePurpose
agentName?stringShown truncated at lg+ when the page knows the agent (dashboard passes it)

components/dashboard/

StatCard

The dashboard's building block — either a simple value card or a container for arbitrary content:

PropTypeDefaultPurpose
titlestringuppercase label row
iconstringMaterial Symbols name
value?string | numberbig display value (ignored when children given)
helper?stringsmall green annotation next to the value
children?ReactNodereplaces the value row entirely (Task Overview, Tool Calls use this)
valueClassName?string"text-on-surface"color override for the value
accent?booleantruethe decorative corner blob that scales on hover
className?string""grid spans etc.

PerformanceCard

Four-metric strip: average latency (ms → s with one decimal), estimated cost ($ with 4 decimals via Number(cost) parse), estimated tokens (locale-formatted), and average quality score (2 decimals, when null). Defensive formatters handle null/NaN throughout — mirroring the backend's nullable metrics.

RecentActivity

Presentational list of ActivityItems (exported type): icon chip colored by tone (success | neutral | primary | warning | error → token classes), title + optional badge, description, meta line. The dashboard page derives these items from metrics — the component itself is dumb and reusable.

components/agents/

AgentCard

One agent in the /agents grid.

PropType
idnumber
name, type, language, tonestring
descriptionstring | null
enabledToolsstring (comma-separated, split & trimmed in-component)
createdAtstring (ISO; invalid dates render "Created recently")

Behavior notes:

  • typeIcons maps the four agent types to Material icons (Email Ops → mark_email_read, …) with smart_toy fallback.
  • Tools render as mono chips; an empty list renders a "none" chip.
  • The status pill is hardcoded "Active" — there is no status field on the backend model.
  • Footer actions: Open links to /agents/{id} (route not yet implemented); Edit and Run Workflow are inert buttons (Known Issues).

components/create-agent/

CreateAgentForm

The platform's only client component ("use client"), and the only holder of client state:

StateTypePurpose
formCreateAgentPayloadall field values; enabled_tools kept as the canonical comma-string
isSubmittingbooleandisables the submit button, swaps its icon/label
errorMessagestring | nullerror banner
createdAgent{id,name,type} | nullsuccess banner

Structure: three form sections (Identity & Core — name, type select, description; Behavior & Brain — system prompt with 4000-char counter, language and tone selects; Enabled Tools — checkbox cards for the four canonical tools with a selected-count pill) plus a sticky Live Preview aside that mirrors name/type/tools/tone in real time, and a safety-guardrails callout.

Key mechanics:

  • toolOptions defines the four tools with descriptions; email_analyzer and document_search are checked by default — matching the backend's canonical names exactly (Tools).
  • updateField clears both banners on any edit; toggleTool recomputes the comma-string.
  • Submit trims all text fields, converts empty description to null, and client-side-requires name/type/system_prompt before ever hitting the network.
  • getApiErrorMessage normalizes backend errors — a detail string passes through; a detail array (FastAPI 422) is flattened by joining each item's msg. See API Proxy.
  • The "Optimize Prompt" button is decorative (no handler) — a roadmap affordance.

Composition diagram

Rendering diagram…

Conventions for new components

  • Server component by default; add "use client" only for interactivity.
  • Type props with an explicit type XProps = .
  • Style exclusively with design tokens (Design System); icons via Material Symbols names.
  • Handle null/absent data defensively in the component (the backend's nullable metrics make this mandatory).