/**
 * Approver Performance Header Component
 */

import { RefreshCw, Users } from 'lucide-react';
import { Button } from '@/components/ui/button';

interface ApproverPerformanceHeaderProps {
  approverName: string;
  refreshing: boolean;
  onRefresh: () => void;
}

export function ApproverPerformanceHeader({
  approverName,
  refreshing,
  onRefresh
}: ApproverPerformanceHeaderProps) {
  return (
    <div className="flex items-center justify-between" data-testid="approver-performance-header">
      <div className="flex items-center gap-3">
        <div className="p-3 bg-yellow-100 rounded-lg">
          <Users className="h-6 w-6 text-yellow-600" />
        </div>
        <div>
          <h1 className="text-2xl font-bold text-gray-900">Approver Performance Report</h1>
          <p className="text-sm text-gray-600">{approverName}</p>
        </div>
      </div>
      <Button
        variant="outline"
        size="sm"
        onClick={onRefresh}
        disabled={refreshing}
        className="gap-2"
        data-testid="refresh-button"
      >
        <RefreshCw className={`w-4 h-4 ${refreshing ? 'animate-spin' : ''}`} />
        <span className="hidden sm:inline">Refresh</span>
      </Button>
    </div>
  );
}

