Function
TaskActionButton
({
action,
disabled,
loading,
onClick,
})
Source from the content-addressed store, hash-verified
| 30 | } as const; |
| 31 | |
| 32 | export const TaskActionButton: FC<TaskActionButtonProps> = ({ |
| 33 | action, |
| 34 | disabled, |
| 35 | loading, |
| 36 | onClick, |
| 37 | }) => { |
| 38 | const config = actionConfig[action]; |
| 39 | const Icon = config.icon; |
| 40 | |
| 41 | return ( |
| 42 | <TooltipProvider> |
| 43 | <Tooltip> |
| 44 | <TooltipTrigger asChild> |
| 45 | <Button |
| 46 | size="icon-lg" |
| 47 | variant="outline" |
| 48 | disabled={disabled || loading} |
| 49 | onClick={(e) => { |
| 50 | e.stopPropagation(); |
| 51 | onClick(); |
| 52 | }} |
| 53 | > |
| 54 | <Spinner loading={loading}> |
| 55 | <Icon aria-hidden="true" /> |
| 56 | </Spinner> |
| 57 | <span className="sr-only">{config.label}</span> |
| 58 | </Button> |
| 59 | </TooltipTrigger> |
| 60 | <TooltipContent>{config.tooltip}</TooltipContent> |
| 61 | </Tooltip> |
| 62 | </TooltipProvider> |
| 63 | ); |
| 64 | }; |
Callers
nothing calls this directly
Tested by
no test coverage detected