'use client';

import { Calculator } from 'lucide-react';
import { AmountCardItem, CheckPointItem, CollapsibleDashboardCard } from '../components';
import type { VatData } from '../types';

interface VatSectionProps {
  data: VatData;
  onClick?: () => void;
}

export function VatSection({ data, onClick }: VatSectionProps) {
  return (
    <CollapsibleDashboardCard
      icon={<Calculator style={{ color: '#ffffff' }} className="h-5 w-5" />}
      title="부가세 현황"
      subtitle="부가세 납부 정보"
    >
      <div className="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-4 gap-4 mb-4">
        {data.cards.map((card) => (
          <AmountCardItem
            key={card.id}
            card={card}
            onClick={onClick}
          />
        ))}
      </div>

      {data.checkPoints.length > 0 && (
        <div className="border-t pt-4 space-y-1">
          {data.checkPoints.map((cp) => (
            <CheckPointItem key={cp.id} checkpoint={cp} />
          ))}
        </div>
      )}
    </CollapsibleDashboardCard>
  );
}
