'use client';

import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/Card';
import { Link2, CheckCircle, AlertCircle, Clock } from 'lucide-react';

export function IntegrationStatusTile() {
  // Mock data - in production, this would come from API
  const integrations = {
    total: 45,
    active: 42,
    pending: 2,
    failed: 1,
  };

  return (
    <Card className="bg-gray-800 border-gray-700">
      <CardHeader>
        <CardTitle className="text-white flex items-center gap-2">
          <Link2 className="h-5 w-5 text-orange-500" />
          Active Integrations
        </CardTitle>
      </CardHeader>
      <CardContent>
        <div className="space-y-4">
          <div className="text-center">
            <p className="text-4xl font-bold text-white mb-2">{integrations.total}</p>
            <p className="text-sm text-gray-400">Total Integrations</p>
          </div>
          
          <div className="space-y-2">
            <div className="flex items-center justify-between p-2 bg-gray-900 rounded">
              <div className="flex items-center gap-2">
                <CheckCircle className="h-4 w-4 text-green-400" />
                <span className="text-sm text-gray-300">Active</span>
              </div>
              <span className="text-sm font-semibold text-white">{integrations.active}</span>
            </div>
            
            {integrations.pending > 0 && (
              <div className="flex items-center justify-between p-2 bg-gray-900 rounded">
                <div className="flex items-center gap-2">
                  <Clock className="h-4 w-4 text-yellow-400" />
                  <span className="text-sm text-gray-300">Pending</span>
                </div>
                <span className="text-sm font-semibold text-white">{integrations.pending}</span>
              </div>
            )}
            
            {integrations.failed > 0 && (
              <div className="flex items-center justify-between p-2 bg-gray-900 rounded">
                <div className="flex items-center gap-2">
                  <AlertCircle className="h-4 w-4 text-red-400" />
                  <span className="text-sm text-gray-300">Failed</span>
                </div>
                <span className="text-sm font-semibold text-white">{integrations.failed}</span>
              </div>
            )}
          </div>
        </div>
      </CardContent>
    </Card>
  );
}

