MCPcopy Create free account
hub / github.com/VGabriel45/SolidityVisualizer / ActionButton

Function ActionButton

src/components/action-button.tsx:20–58  ·  view source on GitHub ↗
({
  onClick,
  icon: Icon,
  tooltipText,
  disabled,
  text,
  loading = false,
}: ActionButtonProps)

Source from the content-addressed store, hash-verified

18}
19
20export function ActionButton({
21 onClick,
22 icon: Icon,
23 tooltipText,
24 disabled,
25 text,
26 loading = false,
27}: ActionButtonProps) {
28 return (
29 <TooltipProvider>
30 <Tooltip>
31 <TooltipTrigger asChild>
32 <Button
33 onClick={(e) => {
34 e.preventDefault();
35 if (!loading) {
36 onClick();
37 }
38 }}
39 disabled={(disabled ?? false) || (loading ?? false)}
40 className="border-[3px] border-black bg-green-400 p-4 px-4 text-base text-black shadow-[4px_4px_0_0_#000000] transition-transform hover:-translate-x-0.5 hover:-translate-y-0.5 hover:transform hover:bg-green-400 sm:p-6 sm:px-6 sm:text-lg relative"
41 >
42 {loading ? (
43 <Loader2 className="h-6 w-6 animate-spin" />
44 ) : (
45 <>
46 <Icon className="h-6 w-6" />
47 {text && <span className="text-sm">{text}</span>}
48 </>
49 )}
50 </Button>
51 </TooltipTrigger>
52 <TooltipContent>
53 <p>{tooltipText}</p>
54 </TooltipContent>
55 </Tooltip>
56 </TooltipProvider>
57 );
58}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected