-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathintegration-card.tsx
More file actions
60 lines (56 loc) · 1.58 KB
/
integration-card.tsx
File metadata and controls
60 lines (56 loc) · 1.58 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
"use client";
import { Card, CardContent } from "@arcadeai/design-system";
import { cn } from "@arcadeai/design-system/lib/utils";
import type { LucideIcon } from "lucide-react";
import { usePostHog } from "posthog-js/react";
type IntegrationCardProps = {
id: string;
icon: LucideIcon;
title: string;
description: string;
isActive?: boolean;
onClick: () => void;
};
export function IntegrationCard({
id,
icon: Icon,
title,
description,
isActive = false,
onClick,
}: IntegrationCardProps) {
const posthog = usePostHog();
const handleClick = () => {
posthog?.capture("integration_card_clicked", {
integration_id: id,
integration_title: title,
is_active: isActive,
});
onClick();
};
return (
<Card
className={cn(
"group relative cursor-pointer overflow-hidden transition-all hover:shadow-md",
isActive
? "border-primary/50 bg-primary/5"
: "border-zinc-800 bg-zinc-900/50 hover:bg-zinc-900"
)}
onClick={handleClick}
>
<div
className={cn(
"absolute inset-0 bg-gradient-to-tr from-white/10 to-transparent transition-opacity",
isActive ? "opacity-100" : "opacity-0 group-hover:opacity-100"
)}
/>
<CardContent className="flex flex-col items-start space-y-2 p-4">
<Icon
className={cn("mb-1 h-6 w-6 text-white", isActive && "text-primary")}
/>
<h3 className="font-medium text-sm text-white">{title}</h3>
<p className="text-xs text-zinc-400">{description}</p>
</CardContent>
</Card>
);
}