'use client';

import { DocumentViewer } from '@/components/document-system';
import { CreditAnalysisDocument } from './CreditAnalysisDocument';
import type { CreditAnalysisData } from './types';

interface CreditAnalysisModalProps {
  open: boolean;
  onOpenChange: (open: boolean) => void;
  data: CreditAnalysisData;
  onApprove?: () => void;
}

export function CreditAnalysisModal({
  open,
  onOpenChange,
  data,
  onApprove,
}: CreditAnalysisModalProps) {
  return (
    <DocumentViewer
      title="SAM 기업 신용분석 리포트"
      subtitle={`${data.companyName} | ${data.businessNumber}`}
      open={open}
      onOpenChange={onOpenChange}
      features={{
        print: true,
        zoom: true,
        drag: true,
      }}
    >
      <CreditAnalysisDocument data={data} onApprove={onApprove} />
    </DocumentViewer>
  );
}

export { MOCK_CREDIT_DATA } from './types';
export type { CreditAnalysisData } from './types';
