mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-10-29 21:07:40 +01:00
Add harness-scoped bulk connection and default-model edits to the agent roster, with compatible choices, change previews, per-agent save results, and retries. Use an icon-based harness filter, keep agent rows readable, remove the status selector and selection hint, and redirect legacy status URLs to the full roster. Preserve authorization, audit history, unrelated settings, and optimistic concurrency checks through the existing agent update route. Co-Authored-By: Paperclip <noreply@paperclip.ing>
29 lines
1.7 KiB
TypeScript
29 lines
1.7 KiB
TypeScript
import { List, Network, Plus } from "lucide-react";
|
|
import { ToolbarSearch } from "./ToolbarSearch";
|
|
import { Button } from "./ui/button";
|
|
|
|
export interface AgentsToolbarProps {
|
|
query: string;
|
|
onQueryChange: (value: string) => void;
|
|
view: "list" | "org";
|
|
onViewChange: (value: "list" | "org") => void;
|
|
hideViewToggle?: boolean;
|
|
onNewAgent: () => void;
|
|
}
|
|
|
|
/** Shared roster search, view controls and actions for the page and stories. */
|
|
export function AgentsToolbar({ query, onQueryChange, view, onViewChange, hideViewToggle, onNewAgent }: AgentsToolbarProps) {
|
|
return <div data-canonical-toolbar="agents" role="toolbar" aria-label="Agents controls" className="flex flex-wrap items-center gap-3">
|
|
<div className="design-toolbar-controls flex w-full flex-wrap items-center gap-4">
|
|
<ToolbarSearch query={query} onQueryChange={onQueryChange} label="Search agents" placeholder="Search agents…" />
|
|
{!hideViewToggle && <div className="design-view-toggle" role="group" aria-label="Agent view">
|
|
<Button type="button" size="icon-sm" variant={view === "list" ? "secondary" : "ghost"} className="design-toolbar-icon" onClick={() => onViewChange("list")} title="List view" aria-label="List view" aria-pressed={view === "list"}><List aria-hidden /></Button>
|
|
<Button type="button" size="icon-sm" variant={view === "org" ? "secondary" : "ghost"} className="design-toolbar-icon" onClick={() => onViewChange("org")} title="Org chart view" aria-label="Org chart view" aria-pressed={view === "org"}><Network aria-hidden /></Button>
|
|
</div>}
|
|
<div className="design-toolbar-actions">
|
|
<Button size="sm" variant="outline" data-toolbar-primary onClick={onNewAgent}><Plus aria-hidden />New Agent</Button>
|
|
</div>
|
|
</div>
|
|
</div>;
|
|
}
|