'use client'; import { useRef } from 'react'; import { Mic, Upload, X, FileText, ExternalLink } from 'lucide-react'; import { Input } from '@/components/ui/input'; import { Label } from '@/components/ui/label'; import { Button } from '@/components/ui/button'; import { CurrencyInput } from '@/components/ui/currency-input'; import { Textarea } from '@/components/ui/textarea'; import type { ProposalData, UploadedFile } from './types'; interface ProposalFormProps { data: ProposalData; onChange: (data: ProposalData) => void; } export function ProposalForm({ data, onChange }: ProposalFormProps) { const fileInputRef = useRef(null); const handleFileChange = (e: React.ChangeEvent) => { const files = e.target.files; if (files) { onChange({ ...data, attachments: [...data.attachments, ...Array.from(files)] }); } }; // 기존 업로드 파일 삭제 const handleRemoveUploadedFile = (fileId: number) => { const updatedFiles = (data.uploadedFiles || []).filter((f) => f.id !== fileId); onChange({ ...data, uploadedFiles: updatedFiles }); }; // 새 첨부 파일 삭제 const handleRemoveAttachment = (index: number) => { const updatedAttachments = data.attachments.filter((_, i) => i !== index); onChange({ ...data, attachments: updatedAttachments }); }; return (
{/* 구매처 정보 */}

구매처 정보

onChange({ ...data, vendor: e.target.value })} />
onChange({ ...data, vendorPaymentDate: e.target.value })} />
{/* 품의서 정보 */}

품의서 정보

{/* 제목 */}
onChange({ ...data, title: e.target.value })} />
{/* 품의 내역 */}