import { BadgeCheck } from 'lucide-react' import Image from 'next/image' import Link from 'next/link' import { Badge, Card, CardContent, cn } from 'ui' import { ShimmeringLoader } from 'ui-patterns/ShimmeringLoader' import { IntegrationDefinition } from './Integrations.constants' import { useSelectedProjectQuery } from '@/hooks/misc/useSelectedProject' type IntegrationCardProps = IntegrationDefinition & { isInstalled?: boolean featured?: boolean image?: string } const INTEGRATION_CARD_STYLE = cn( 'w-full h-full bg-surface-100 hover:bg-surface-200 hover:border-strong', 'border border-border rounded-md ease-out duration-200 transition-all' ) export const IntegrationLoadingCard = () => { return (
) } export const IntegrationCard = ({ id, listingId, status, name, icon, description, isInstalled, featured = false, image, }: IntegrationCardProps) => { const { data: project } = useSelectedProjectQuery() const shouldShowOfficialBadge = !listingId if (featured) { return ( {/* Full-width image/icon at the top */}
{image ? ( {`${name} ) : (
{icon({ className: 'w-full h-full text-foreground' })}
)}

{name}

{description}

{status && {status}} {shouldShowOfficialBadge && Official}
) } return (
{icon()}
{isInstalled && (
Installed
)}

{name}

{description}

{status && {status}} {shouldShowOfficialBadge && Official}
) }