({
tooltip,
children,
label,
variant = "ghost",
size = "icon-sm",
...props
}: MessageActionProps)
| 81 | }; |
| 82 | |
| 83 | export const MessageAction = ({ |
| 84 | tooltip, |
| 85 | children, |
| 86 | label, |
| 87 | variant = "ghost", |
| 88 | size = "icon-sm", |
| 89 | ...props |
| 90 | }: MessageActionProps) => { |
| 91 | const button = ( |
| 92 | <Button size={size} type="button" variant={variant} {...props}> |
| 93 | {children} |
| 94 | <span className="sr-only">{label || tooltip}</span> |
| 95 | </Button> |
| 96 | ); |
| 97 | |
| 98 | if (tooltip) { |
| 99 | return ( |
| 100 | <TooltipProvider> |
| 101 | <Tooltip> |
| 102 | <TooltipTrigger asChild>{button}</TooltipTrigger> |
| 103 | <TooltipContent> |
| 104 | <p>{tooltip}</p> |
| 105 | </TooltipContent> |
| 106 | </Tooltip> |
| 107 | </TooltipProvider> |
| 108 | ); |
| 109 | } |
| 110 | |
| 111 | return button; |
| 112 | }; |
| 113 | |
| 114 | interface MessageBranchContextType { |
| 115 | currentBranch: number; |
nothing calls this directly
no outgoing calls
no test coverage detected