'use client';

import { GitBranch, PlayCircle, PauseCircle, AlertCircle } from 'lucide-react';

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

export function DataPipelineTile() {
  // Mock data - in production, this would come from API
  const pipelines = {
    running: 12,
    failed: 1,
    pending: 3,
    total: 16,
  };

  return (
    <Card className="bg-gray-800 border-gray-700">
      <CardHeader>
        <CardTitle className="text-white flex items-center gap-2">
          <GitBranch className="h-5 w-5 text-orange-500" />
          Data Pipeline Status
        </CardTitle>
      </CardHeader>
      <CardContent>
        <div className="space-y-4">
          <div className="grid grid-cols-2 gap-4">
            <div className="p-3 bg-gray-900 rounded-lg">
              <div className="flex items-center gap-2 mb-2">
                <PlayCircle className="h-4 w-4 text-green-400" />
                <span className="text-sm text-gray-400">Running</span>
              </div>
              <p className="text-2xl font-bold text-white">{pipelines.running}</p>
            </div>
            
            <div className="p-3 bg-gray-900 rounded-lg">
              <div className="flex items-center gap-2 mb-2">
                <PauseCircle className="h-4 w-4 text-yellow-400" />
                <span className="text-sm text-gray-400">Pending</span>
              </div>
              <p className="text-2xl font-bold text-white">{pipelines.pending}</p>
            </div>
          </div>

          {pipelines.failed > 0 && (
            <div className="p-3 bg-red-500/10 border border-red-500/20 rounded-lg">
              <div className="flex items-center gap-2">
                <AlertCircle className="h-4 w-4 text-red-400" />
                <span className="text-sm text-red-400 font-semibold">
                  {pipelines.failed} pipeline{pipelines.failed > 1 ? 's' : ''} failed
                </span>
              </div>
            </div>
          )}

          <div className="pt-2 border-t border-gray-700">
            <p className="text-xs text-gray-400">Total Pipelines: <span className="text-white font-semibold">{pipelines.total}</span></p>
          </div>
        </div>
      </CardContent>
    </Card>
  );
}

