'use client'; import { Mic } 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 { FileDropzone } from '@/components/ui/file-dropzone'; import { FileList, type NewFile, type ExistingFile } from '@/components/ui/file-list'; import type { ProposalData, UploadedFile } from './types'; interface ProposalFormProps { data: ProposalData; onChange: (data: ProposalData) => void; } export function ProposalForm({ data, onChange }: ProposalFormProps) { const handleFilesSelect = (files: File[]) => { onChange({ ...data, attachments: [...data.attachments, ...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 })} />
{/* 품의 내역 */}