import React from "react"; import { Check } from "lucide-react"; import { Badge } from "./badge"; import { Button } from "./button"; import { cn } from "../../lib/utils"; export interface IntegrationCardProps { name: string; description: string; /** Image src for the integration logo (e.g. aggregator logo) */ logoSrc?: string; /** Fallback icon node shown when no logoSrc is provided but a logo area is desired */ logoFallback?: React.ReactNode; connected?: boolean; onConnect?: () => void; onDisconnect?: () => void; /** Extra content rendered between description and action button (e.g. inbox assignment Select) */ children?: React.ReactNode; className?: string; } export function IntegrationCard({ name, description, logoSrc, logoFallback, connected = false, onConnect, onDisconnect, children, className, }: IntegrationCardProps) { const hasLogo = Boolean(logoSrc || logoFallback); return (
{hasLogo && (
{logoSrc ? ( {`${name} ) : (
{logoFallback}
)}
)} {name} {connected && ( Connected )}

{description}

{children} {!connected && onConnect && (
)} {connected && onDisconnect && (
)}
); }