({ integrations }: IntegrationStatusProps)
| 53 | }; |
| 54 | |
| 55 | export function IntegrationStatus({ integrations }: IntegrationStatusProps) { |
| 56 | if (!integrations) { |
| 57 | return ( |
| 58 | <div className="bg-gray-900 rounded-xl p-6 animate-pulse"> |
| 59 | <div className="h-6 bg-gray-800 rounded w-1/3 mb-4"></div> |
| 60 | <div className="space-y-3"> |
| 61 | <div className="h-16 bg-gray-800 rounded"></div> |
| 62 | <div className="h-16 bg-gray-800 rounded"></div> |
| 63 | <div className="h-16 bg-gray-800 rounded"></div> |
| 64 | </div> |
| 65 | </div> |
| 66 | ); |
| 67 | } |
| 68 | |
| 69 | return ( |
| 70 | <div className="bg-gray-900 rounded-xl p-6"> |
| 71 | <h2 className="text-xl font-semibold text-white mb-6 flex items-center gap-2"> |
| 72 | <MessageCircle className="w-5 h-5 text-emerald-400" /> |
| 73 | Integrations |
| 74 | </h2> |
| 75 | |
| 76 | <div className="space-y-3"> |
| 77 | {integrations.map((integration) => { |
| 78 | const Icon = iconMap[integration.icon] || MessageCircle; |
| 79 | const status = statusConfig[integration.status]; |
| 80 | const StatusIcon = status.icon; |
| 81 | |
| 82 | return ( |
| 83 | <div |
| 84 | key={integration.id} |
| 85 | className={`flex items-center justify-between p-4 rounded-lg border ${status.bg} ${status.border}`} |
| 86 | > |
| 87 | <div className="flex items-center gap-3"> |
| 88 | <div className="p-2 bg-gray-800 rounded-lg"> |
| 89 | <Icon className="w-5 h-5 text-gray-300" /> |
| 90 | </div> |
| 91 | <div> |
| 92 | <div className="font-medium text-white">{integration.name}</div> |
| 93 | {integration.lastActivity && ( |
| 94 | <div className="text-xs text-gray-400"> |
| 95 | Last activity:{" "} |
| 96 | {formatDistanceToNow(new Date(integration.lastActivity), { |
| 97 | addSuffix: true, |
| 98 | })} |
| 99 | </div> |
| 100 | )} |
| 101 | </div> |
| 102 | </div> |
| 103 | |
| 104 | <div className={`flex items-center gap-2 ${status.color}`}> |
| 105 | <StatusIcon className="w-4 h-4" /> |
| 106 | <span className="text-sm font-medium">{status.label}</span> |
| 107 | </div> |
| 108 | </div> |
| 109 | ); |
| 110 | })} |
| 111 | </div> |
| 112 | </div> |
nothing calls this directly
no outgoing calls
no test coverage detected