'use client';

import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/Card';
import { DollarSign, TrendingUp, TrendingDown } from 'lucide-react';

export function CostOverviewTile() {
  // Mock data - in production, this would come from API
  const costData = {
    currentMonth: 45230,
    lastMonth: 38950,
    trend: 'up',
    percentageChange: 16.1,
  };

  const trend = costData.trend === 'up' ? TrendingUp : TrendingDown;
  const TrendIcon = trend;
  const trendColor = costData.trend === 'up' ? 'text-red-400' : 'text-green-400';

  return (
    <Card className="bg-gray-800 border-gray-700">
      <CardHeader>
        <CardTitle className="text-white flex items-center gap-2">
          <DollarSign className="h-5 w-5 text-orange-500" />
          Cost Overview
        </CardTitle>
      </CardHeader>
      <CardContent>
        <div className="space-y-4">
          <div>
            <p className="text-3xl font-bold text-white mb-1">
              ${costData.currentMonth.toLocaleString()}
            </p>
            <p className="text-sm text-gray-400">Current Month</p>
          </div>
          
          <div className="flex items-center gap-2 p-3 bg-gray-900 rounded-lg">
            <TrendIcon className={`h-4 w-4 ${trendColor}`} />
            <span className={`text-sm font-semibold ${trendColor}`}>
              {costData.percentageChange}% vs last month
            </span>
          </div>

          <div className="pt-2 border-t border-gray-700">
            <p className="text-xs text-gray-400">
              Last month: <span className="text-white font-semibold">${costData.lastMonth.toLocaleString()}</span>
            </p>
          </div>
        </div>
      </CardContent>
    </Card>
  );
}

