'use client';

import { Rocket, CheckCircle, Clock, XCircle } from 'lucide-react';

import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/Card';

export function DeploymentsTile() {
  // Mock data - in production, this would come from API
  const deployments = {
    active: 8,
    syncing: 2,
    failed: 0,
    total: 10,
  };

  return (
    <Card className="bg-gray-800 border-gray-700">
      <CardHeader>
        <CardTitle className="text-white flex items-center gap-2">
          <Rocket className="h-5 w-5 text-orange-500" />
          Active Deployments
        </CardTitle>
      </CardHeader>
      <CardContent>
        <div className="space-y-4">
          <div className="text-center">
            <p className="text-4xl font-bold text-white mb-2">{deployments.total}</p>
            <p className="text-sm text-gray-400">Total Deployments</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">Synced</span>
              </div>
              <span className="text-sm font-semibold text-white">{deployments.active}</span>
            </div>
            
            {deployments.syncing > 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">Syncing</span>
                </div>
                <span className="text-sm font-semibold text-white">{deployments.syncing}</span>
              </div>
            )}
            
            {deployments.failed > 0 && (
              <div className="flex items-center justify-between p-2 bg-gray-900 rounded">
                <div className="flex items-center gap-2">
                  <XCircle 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">{deployments.failed}</span>
              </div>
            )}
          </div>
        </div>
      </CardContent>
    </Card>
  );
}

