diff options
Diffstat (limited to 'lib/vendor-document-list/ship/bulk-b4-upload-dialog.tsx')
| -rw-r--r-- | lib/vendor-document-list/ship/bulk-b4-upload-dialog.tsx | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/lib/vendor-document-list/ship/bulk-b4-upload-dialog.tsx b/lib/vendor-document-list/ship/bulk-b4-upload-dialog.tsx index 43788c8a..3ff2f467 100644 --- a/lib/vendor-document-list/ship/bulk-b4-upload-dialog.tsx +++ b/lib/vendor-document-list/ship/bulk-b4-upload-dialog.tsx @@ -52,7 +52,6 @@ import { FileText, } from "lucide-react" -import { SimplifiedDocumentsView } from "@/db/schema" import { bulkUploadB4Documents } from "../enhanced-document-service" // 파일명 파싱 유틸리티 @@ -94,10 +93,15 @@ const formSchema = z.object({ files: z.array(z.instanceof(File)).min(1, "Please select files"), }) +export interface ProjectOption { + id: string + code: string +} + interface BulkB4UploadDialogProps { open: boolean onOpenChange: (open: boolean) => void - allDocuments: SimplifiedDocumentsView[] + projectOptions: ProjectOption[] } interface ParsedFile { @@ -110,8 +114,8 @@ interface ParsedFile { export function BulkB4UploadDialog({ open, - onOpenChange, - allDocuments + onOpenChange, + projectOptions }: BulkB4UploadDialogProps) { const [isUploading, setIsUploading] = React.useState(false) const [parsedFiles, setParsedFiles] = React.useState<ParsedFile[]>([]) @@ -121,15 +125,6 @@ export function BulkB4UploadDialog({ const [pendingProjectId, setPendingProjectId] = React.useState<string>("") const router = useRouter() - // 프로젝트 ID 추출 - const projectOptions = React.useMemo(() => { - const projectIds = [...new Set(allDocuments.map(doc => doc.projectId).filter(Boolean))] - return projectIds.map(id => ({ - id: String(id), - code: allDocuments.find(doc => doc.projectId === id)?.projectCode || `Project ${id}` - })) - }, [allDocuments]) - const form = useForm<z.infer<typeof formSchema>>({ resolver: zodResolver(formSchema), defaultValues: { |
