MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / ToolkitSection

Function ToolkitSection

packages/plugins/toolkits/src/page.tsx:618–658  ·  view source on GitHub ↗
(props: {
  owner: Owner;
  title?: string;
  showOwnerLabels: boolean;
  toolkits: readonly ToolkitResponse[];
  onCreate: (input: { owner: Owner; name: string }) => Promise<void>;
})

Source from the content-addressed store, hash-verified

616}
617
618function ToolkitSection(props: {
619 owner: Owner;
620 title?: string;
621 showOwnerLabels: boolean;
622 toolkits: readonly ToolkitResponse[];
623 onCreate: (input: { owner: Owner; name: string }) => Promise<void>;
624}) {
625 const rows = [...props.toolkits].sort(compareToolkitRows);
626 const [createOpen, setCreateOpen] = useState(false);
627 const openCreate = () => setCreateOpen(true);
628 return (
629 <section className="space-y-3">
630 {props.title ? (
631 <div className="border-b border-border/60 pb-2">
632 <h2 className="text-xs font-semibold uppercase tracking-widest text-muted-foreground">
633 {props.title}
634 </h2>
635 </div>
636 ) : null}
637
638 <div className="grid content-start grid-cols-1 gap-3 sm:grid-cols-2 md:grid-cols-3">
639 {rows.map((toolkit) => (
640 <ToolkitTile key={toolkit.id} showOwnerLabels={props.showOwnerLabels} toolkit={toolkit} />
641 ))}
642 <AddToolkitCard
643 owner={props.owner}
644 showOwnerLabels={props.showOwnerLabels}
645 onClick={openCreate}
646 />
647 </div>
648
649 <CreateToolkitDialog
650 owner={props.owner}
651 showOwnerLabels={props.showOwnerLabels}
652 open={createOpen}
653 onOpenChange={setCreateOpen}
654 onCreate={props.onCreate}
655 />
656 </section>
657 );
658}
659
660function ToolkitGrid(props: {
661 toolkits: readonly ToolkitResponse[];

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected