"use client" import React from "react" import Link from "../../embed-shims/next-link" import { Monitor } from "lucide-react" import { cn } from "../../utils/cn" import { EntityImage } from "./entity-image" export interface Organization { id: string organizationId?: string name: string imageUrl?: string | null industry?: string tier?: string websiteUrl?: string description?: string totalDevices?: number activeDevices?: number mrrUsd?: number [key: string]: any } export interface OrganizationCardProps { organization: Organization fetchedImageUrl?: string className?: string href?: string showActionButton?: boolean actionButton?: { icon: React.ReactNode label: string onClick: (org: Organization, e: React.MouseEvent) => void variant?: 'ghost' | 'primary' disabled?: boolean } footerStats?: Array<{ icon?: React.ReactNode value: string | number label?: string }> customFooter?: React.ReactNode deviceCount?: number } export function OrganizationCard({ organization, fetchedImageUrl, className, href, showActionButton = false, actionButton, footerStats, customFooter, deviceCount }: OrganizationCardProps) { const handleActionClick = (e: React.MouseEvent) => { e.preventDefault() e.stopPropagation() actionButton?.onClick(organization, e) } const card = (
{/* Device count (top-right) */} {deviceCount !== undefined && (
{deviceCount.toLocaleString()} devices
)} {/* Action button (top-right) - only if no device count */} {!deviceCount && showActionButton && actionButton && ( )} {/* Header */}

{organization.name}

{organization.industry || organization.tier || organization.websiteUrl || "Organization"}

{/* Description */} {organization.description && (

{organization.description}

)} {/* Footer */} {customFooter ? ( customFooter ) : footerStats && footerStats.length > 0 ? (
{footerStats.map((stat, index) => (
{stat.icon} {typeof stat.value === 'number' ? stat.value.toLocaleString() : stat.value} {stat.label && ( {stat.label} )}
))}
) : null}
) if (href) { return ( {card} ) } return card }