MCPcopy Create free account
hub / github.com/MagicCube/agentara / PromptInputButton

Function PromptInputButton

web/src/components/ai-elements/prompt-input.tsx:1005–1045  ·  view source on GitHub ↗
({
  variant = "ghost",
  className,
  size,
  tooltip,
  ...props
}: PromptInputButtonProps)

Source from the content-addressed store, hash-verified

1003};
1004
1005export const PromptInputButton = ({
1006 variant = "ghost",
1007 className,
1008 size,
1009 tooltip,
1010 ...props
1011}: PromptInputButtonProps) => {
1012 const newSize =
1013 size ?? (Children.count(props.children) > 1 ? "sm" : "icon-sm");
1014
1015 const button = (
1016 <InputGroupButton
1017 className={cn(className)}
1018 size={newSize}
1019 type="button"
1020 variant={variant}
1021 {...props}
1022 />
1023 );
1024
1025 if (!tooltip) {
1026 return button;
1027 }
1028
1029 const tooltipContent =
1030 typeof tooltip === "string" ? tooltip : tooltip.content;
1031 const shortcut = typeof tooltip === "string" ? undefined : tooltip.shortcut;
1032 const side = typeof tooltip === "string" ? "top" : (tooltip.side ?? "top");
1033
1034 return (
1035 <Tooltip>
1036 <TooltipTrigger asChild>{button}</TooltipTrigger>
1037 <TooltipContent side={side}>
1038 {tooltipContent}
1039 {shortcut && (
1040 <span className="ml-2 text-muted-foreground">{shortcut}</span>
1041 )}
1042 </TooltipContent>
1043 </Tooltip>
1044 );
1045};
1046
1047export type PromptInputActionMenuProps = ComponentProps<typeof DropdownMenu>;
1048export const PromptInputActionMenu = (props: PromptInputActionMenuProps) => (

Callers

nothing calls this directly

Calls 1

cnFunction · 0.90

Tested by

no test coverage detected