generic-tool
agent-elements/generic-toolFreeComponent
agent-elements publishes no description for this item.
Live preview
live · rendered by the registry
Rendered by agent-elements on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://agent-elements.21st.dev/r/generic-tool.jsonSource
1import React, { memo } from "react";2import type { TimelineStep, StepState } from "../types/timeline";3import { useToolComplete } from "../hooks/use-tool-complete";4import { ToolRowBase } from "./tool-row-base";56export type GenericToolRowProps = {7 step: Extract<TimelineStep, { type: "tool-call" }>;8 state: StepState;9 onComplete: () => void;10};1112export function GenericToolRow({13 step,14 state,15 onComplete,16}: GenericToolRowProps) {17 useToolComplete(state === "animating", step.duration, onComplete);18 const isPending = state === "animating";1920 return (21 <ToolRowBase22 shimmerLabel={step.toolName}23 completeLabel={step.toolName}24 isAnimating={isPending}25 detail={step.toolDetail}26 />27 );28}2930export type GenericToolProps = {31 icon?: React.ComponentType<{ className?: string }>;32 title: string;33 subtitle?: string;34 isPending: boolean;35 isError?: boolean;36};3738export const GenericTool = memo(function GenericTool({39 icon,40 title,41 subtitle,42 isPending,43}: GenericToolProps) {44 const Icon = icon;4546 return (47 <ToolRowBase48 icon={49 Icon ? (50 <Icon className="w-full h-full shrink-0 text-muted-foreground" />51 ) : undefined52 }53 shimmerLabel={title}54 completeLabel={title}55 isAnimating={isPending}56 detail={subtitle}57 />58 );59});
More from agent-elements
All 25 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| agent-chatagent-chat | agent-elements | Components | Free | no deps | |
| attachment-buttonattachment-button | agent-elements | Components | Free | no deps | |
| bash-toolbash-tool | agent-elements | Components | Free | no deps | |
| edit-tooledit-tool | agent-elements | Components | Free | no deps | |
| error-messageerror-message | agent-elements | Components | Free | no deps | |
| file-attachmentfile-attachment | agent-elements | Components | Free | no deps | |
| input-barinput-bar | agent-elements | Components | Free | no deps | |
| markdownmarkdown | agent-elements | Components | Free | no deps |
