'use client';

import { Card, CardContent } from '@/components/ui/card';
import { SectionTitle, AmountCardItem, CheckPointItem } from '../components';
import type { VatData } from '../types';

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

export function VatSection({ data, onClick }: VatSectionProps) {
  return (
    <Card>
      <CardContent className="p-6">
        <SectionTitle title="부가세 현황" badge="warning" />

        <div className="grid 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>
        )}
      </CardContent>
    </Card>
  );
}