'use client';

/**
 * 간접 공사 내역서 모달
 *
 * document-system 통합 버전 (2026-01-22)
 */

import { Edit, Trash2 } from 'lucide-react';
import { Button } from '@/components/ui/button';
import { toast } from 'sonner';
import { DocumentViewer } from '@/components/document-system';
import type { ProgressBillingDetailFormData } from '../types';
import { IndirectConstructionContent } from './IndirectConstructionContent';

interface IndirectConstructionModalProps {
  open: boolean;
  onOpenChange: (open: boolean) => void;
  data: ProgressBillingDetailFormData;
}

export function IndirectConstructionModal({
  open,
  onOpenChange,
  data,
}: IndirectConstructionModalProps) {
  const handleEdit = () => {
    toast.info('수정 기능은 준비 중입니다.');
  };

  const handleDelete = () => {
    toast.info('삭제 기능은 준비 중입니다.');
  };

  const toolbarExtra = (
    <>
      <Button variant="outline" size="sm" onClick={handleEdit}>
        <Edit className="h-4 w-4 mr-1" />
        수정
      </Button>
      <Button variant="outline" size="sm" onClick={handleDelete}>
        <Trash2 className="h-4 w-4 mr-1" />
        삭제
      </Button>
    </>
  );

  return (
    <DocumentViewer
      title="간접 공사 내역서"
      preset="inspection"
      open={open}
      onOpenChange={onOpenChange}
      toolbarExtra={toolbarExtra}
    >
      <IndirectConstructionContent data={data} />
    </DocumentViewer>
  );
}
