-
Notifications
You must be signed in to change notification settings - Fork 254
Expand file tree
/
Copy pathcodeHostIconButton.tsx
More file actions
35 lines (32 loc) · 993 Bytes
/
codeHostIconButton.tsx
File metadata and controls
35 lines (32 loc) · 993 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
'use client';
import { Button } from "@/components/ui/button";
import useCaptureEvent from "@/hooks/useCaptureEvent";
import { cn } from "@/lib/utils";
import Image from "next/image";
interface CodeHostIconButton {
name: string;
logo: { src: string, className?: string };
onClick: () => void;
}
export const CodeHostIconButton = ({
name,
logo,
onClick,
}: CodeHostIconButton) => {
const captureEvent = useCaptureEvent();
return (
<Button
className="flex flex-col items-center justify-center p-4 w-36 h-36 cursor-pointer gap-2"
variant="outline"
onClick={() => {
captureEvent('wa_connect_code_host_button_pressed', {
name,
})
onClick();
}}
>
<Image src={logo.src} alt={name} className={cn("w-8 h-8", logo.className)} />
<p className="text-sm font-medium text-center">{name}</p>
</Button>
)
}