From 50716e363d6b04e068d87757de14d6cb089649f7 Mon Sep 17 00:00:00 2001 From: Luis Date: Wed, 7 Jan 2026 14:56:00 -0700 Subject: [PATCH] se instala libreia de iconos y se modifica vista para habilitar selccion multiple y carga de archivos. --- package-lock.json | 10 + package.json | 1 + src/pages/PedimentoDetail.jsx | 965 ++++++++++++++++++++++++++++++++-- 3 files changed, 928 insertions(+), 48 deletions(-) diff --git a/package-lock.json b/package-lock.json index 57f0e3a..f604c9f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,6 +15,7 @@ "chart.js": "^4.5.0", "highlight.js": "^11.11.1", "jszip": "^3.10.1", + "lucide-react": "^0.562.0", "react": "^19.1.0", "react-chartjs-2": "^5.3.0", "react-dom": "^19.1.0", @@ -2603,6 +2604,15 @@ "yallist": "^3.0.2" } }, + "node_modules/lucide-react": { + "version": "0.562.0", + "resolved": "https://registry.npmjs.org/lucide-react/-/lucide-react-0.562.0.tgz", + "integrity": "sha512-82hOAu7y0dbVuFfmO4bYF1XEwYk/mEbM5E+b1jgci/udUBEE/R7LF5Ip0CCEmXe8AybRM8L+04eP+LGZeDvkiw==", + "license": "ISC", + "peerDependencies": { + "react": "^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0" + } + }, "node_modules/memoize-one": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/memoize-one/-/memoize-one-5.2.1.tgz", diff --git a/package.json b/package.json index 784ce1c..83c143b 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ "chart.js": "^4.5.0", "highlight.js": "^11.11.1", "jszip": "^3.10.1", + "lucide-react": "^0.562.0", "react": "^19.1.0", "react-chartjs-2": "^5.3.0", "react-dom": "^19.1.0", diff --git a/src/pages/PedimentoDetail.jsx b/src/pages/PedimentoDetail.jsx index e15d6e8..7a7e55b 100644 --- a/src/pages/PedimentoDetail.jsx +++ b/src/pages/PedimentoDetail.jsx @@ -1,4 +1,6 @@ import React, { useEffect, useState, useRef } from 'react'; +import { FileUp } from 'lucide-react'; + // Animación fade-in/slide-up para bloques const fadeInSlideUp = `@keyframes fadein-slideup { 0% { opacity: 0; transform: translateY(40px); } @@ -2312,6 +2314,247 @@ const handleDeleteSelectedPedimentoDocuments = async () => { setDownloadingPartidas(false); }; + // Función para eliminar documentos seleccionados de partida vu + const handleDeleteSelectedPartidaVU= async () => { + + if (selectedPartidas.length === 0) { + showMessage('No hay documentos seleccionados para eliminar', 'warning'); + return; + } + + try { + + showMessage(`Eliminando ${selectedPartidas.length} documento(s)...`, 'info'); + + const response = await fetchWithAuth(`${API_URL}/record/documents/bulk-delete-partidas-vu/`, { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + body: JSON.stringify({ + ids: selectedPartidas + }) + }); + + if (!response.ok) { + const errorData = await response.json().catch(() => null); + throw new Error(errorData?.detail || errorData?.message || errorData?.error || `Error ${response.status}: ${response.statusText}`); + } + + const result = await response.json(); + + showMessage( + `${result.deleted_count || selectedPartidas.length} documento(s) eliminado(s) exitosamente`, + 'success' + ); + + setSelectedPartidas([]); + + // Forzar recarga de documentos + const currentPage = partidasPage; + setPartidasPage(0); + setTimeout(() => setPartidasPage(currentPage), 100); + + } catch (error) { + showMessage(`Error durante la eliminación: ${error.message}`, 'error'); + } + + }; + + //--- Funciones de seleccion de Coves --- // + const [selectedCoves, setSelectedCoves] = useState([]); + + const allCoveIds=coves.map(cove => cove.id); + const allCovesSelected=selectedCoves.length === allCoveIds.length && allCoveIds.length > 0; + + const handleSelectAllCoves = () => { + if (allCovesSelected) setSelectedCoves([]); + else setSelectedCoves(allCoveIds); + }; + + const handleSelectCove = (id) => { + setSelectedCoves(prev => prev.includes(id) ? prev.filter(x => x !== id) : [...prev, id]); + }; + + // Función para eliminar documentos seleccionados de coves vu + const handleDeleteSelectedCovesVU= async () => { + + if (selectedCoves.length === 0) { + showMessage('No hay documentos seleccionados para eliminar', 'warning'); + return; + } + + try { + + showMessage(`Eliminando ${selectedCoves.length} documento(s)...`, 'info'); + + const response = await fetchWithAuth(`${API_URL}/record/documents/bulk-delete-coves-vu/`, { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + body: JSON.stringify({ + ids: selectedCoves + }) + }); + + if (!response.ok) { + const errorData = await response.json().catch(() => null); + throw new Error(errorData?.detail || errorData?.message || errorData?.error || `Error ${response.status}: ${response.statusText}`); + } + + const result = await response.json(); + + showMessage( + `${result.deleted_count || selectedCoves.length} documento(s) eliminado(s) exitosamente`, + 'success' + ); + + setSelectedCoves([]); + + // Forzar recarga de documentos + // const currentPage = covesPage; + setCovesPage(0); + setTimeout(() => setCovesPage(1), 100); + + } catch (error) { + showMessage(`Error durante la eliminación: ${error.message}`, 'error'); + } + + }; + + //--- Funciones seleccion de Pedimentos --- // + const [selectedPedimentos, setSelectedPedimentos] = useState([]); + const [isSelectAllPedimentos, setIsSelectAllPedimentos] = useState(false); + + const allPedimentoIds=peddocuments.map(pedimento => pedimento.id); + const allPedimentosSelected=selectedPedimentos.length === allPedimentoIds.length && allPedimentoIds.length > 0; + + const handleSelectAllPedimentos = () => { + if (allPedimentosSelected) { + setSelectedPedimentos([]); + setIsSelectAllPedimentos(false); + } + else{ + setSelectedPedimentos(allPedimentoIds); + setIsSelectAllPedimentos(true); + } + }; + + const handleSelectPedimento = (id) => { + setSelectedPedimentos(prev => prev.includes(id) ? prev.filter(x => x !== id) : [...prev, id]); + }; + + // Función para eliminar documentos seleccionados de pedimento vu + const handleDeleteSelectedPedimentosVU= async () => { + + if (selectedPedimentos.length === 0) { + showMessage('No hay documentos seleccionados para eliminar', 'warning'); + return; + } + + try { + + showMessage(`Eliminando ${selectedPedimentos.length} documento(s)...`, 'info'); + + const response = await fetchWithAuth(`${API_URL}/record/documents/bulk-delete/`, { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + body: JSON.stringify({ + ids: selectedPedimentos + }) + }); + + if (!response.ok) { + const errorData = await response.json().catch(() => null); + throw new Error(errorData?.detail || errorData?.message || `Error ${response.status}: ${response.statusText}`); + } + + const result = await response.json(); + + showMessage( + `${result.deleted_count || selectedPedimentos.length} documento(s) eliminado(s) exitosamente`, + 'success' + ); + + setSelectedPedimentos([]); + + // Forzar recarga de documentos + const currentPage = pedimentoPage; + setPedimentoPage(0); + setTimeout(() => setPedimentoPage(currentPage), 100); + + } catch (error) { + showMessage(`Error durante la eliminación: ${error.message}`, 'error'); + } + + }; + + //--- Funciones seleccion de Edocuments --- // + const [selectedEdocs, setSelectedEdocs] = useState([]); + + const allEdocIds=edocs.map(edoc => edoc.id); + const allEdocsSelected=selectedEdocs.length === allEdocIds.length && allEdocIds.length > 0; + + const handleSelectAllEdocs = () => { + if (allEdocsSelected) setSelectedEdocs([]); + else setSelectedEdocs(allEdocIds); + }; + + const handleSelectEdoc = (id) => { + setSelectedEdocs(prev => prev.includes(id) ? prev.filter(x => x !== id) : [...prev, id]); + }; + + // Función para eliminar documentos seleccionados de partida vu + const handleDeleteSelectedEdocsVU= async () => { + + if (selectedEdocs.length === 0) { + showMessage('No hay documentos seleccionados para eliminar', 'warning'); + return; + } + + try { + + showMessage(`Eliminando ${selectedEdocs.length} documento(s)...`, 'info'); + + const response = await fetchWithAuth(`${API_URL}/record/documents/bulk-delete-edocs-vu/`, { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + body: JSON.stringify({ + ids: selectedEdocs + }) + }); + + if (!response.ok) { + const errorData = await response.json().catch(() => null); + throw new Error(errorData?.detail || errorData?.error || errorData?.message || `Error ${response.status}: ${response.statusText}`); + } + + const result = await response.json(); + + showMessage( + `${result.deleted_count || selectedEdocs.length} documento(s) eliminado(s) exitosamente`, + 'success' + ); + + setSelectedEdocs([]); + + // Forzar recarga de documentos + const currentPage = edocsPage; + setEdocsPage(0); + setTimeout(() => setEdocsPage(currentPage), 100); + + } catch (error) { + showMessage(`Error durante la eliminación: ${error.message}`, 'error'); + } + + }; + + // const downloadAllPartidas = async () => { setDownloadingAllPartidas(true); try { @@ -2325,6 +2568,267 @@ const handleDeleteSelectedPedimentoDocuments = async () => { } }; + //--- Carga de documentos a partidas ---// + // Estados adicionales para subir documentos a partida + const [uploadingToPartida, setUploadingToPartida] = useState(null); + const [selectedPartidaForUpload, setSelectedPartidaForUpload] = useState(null); + + const [uploadingToDocumento, setUploadingToDocumento] = useState(null); + const [selectedDocumentForUpload, setSelectedDocumentForUpload] = useState(null); + const [uploadModalOpen, setUploadModalOpen] = useState(false); + const [uploadFiles, setUploadFiles] = useState([]); + + // Función para manejar la carga de documentos a una partida + const handleUploadToPartida = (partida) => { + console.log(partida); + // setSelectedPartidaForUpload(partida); + partida.tab = 'partida'; + partida.numero = partida.numero_partida; + setSelectedDocumentForUpload(partida); + setUploadFiles([]); + setUploadModalOpen(true); + }; + // Función para subir documentos a la partida seleccionada + const handleUploadFilesToPartida = async () => { + if (!selectedPartidaForUpload || uploadFiles.length === 0) { + showMessage('Por favor selecciona al menos un archivo', 'warning'); + return; + } + + setUploadingToPartida(selectedPartidaForUpload.id); + + try{ + + const formData = new FormData(); + + // Agregar el ID de la partida + formData.append('partida_id', selectedPartidaForUpload.id); + // Agregar el ID del pedimento (por si acaso) + formData.append('pedimento_id', id); + // Agregar archivos al FormData + uploadFiles.forEach((file) => { + formData.append('files', file); + }); + + showMessage(`Subiendo ${uploadFiles.length} archivo(s) a la partida ${selectedPartidaForUpload.numero_partida}...`, 'info'); + + // const result = await postFormDataWithAuth(`${API_URL}/record/documents/bulk-upload/`, formData); + + // showMessage( + // `${result.uploaded_count || uploadFiles.length} archivo(s) subido(s) exitosamente a la partida ${selectedPartidaForUpload.numero_partida}`, + // 'success' + // ); + + // Recargar las partidas para mostrar los nuevos documentos + fetchPedimentoPartidas(partidasPage, partidasPageSize, partidasFilters) + .then((data) => { + setPartidas(data.results || []); + setPartidasCount(data.count || 0); + }) + .catch(err => { + console.error('Error recargando partidas:', err); + }); + + // Limpiar y cerrar + setSelectedPartidaForUpload(null); + setUploadFiles([]); + setUploadModalOpen(false) + + }catch (error){ + showMessage(`Error durante la subida: ${error.message}`, 'error'); + } finally { + setUploadingToPartida(null); + } + + }; + + // Función para manejar la selección de archivos + const handleUploadFileSelect = (event, fileExtension, seccion) => { + + if (!event.target.files) return; // Evitar errores si es null + + try{ + + const selectedFiles = Array.from(event.target.files).filter(file => + file?.name?.toLowerCase().endsWith(fileExtension) + ); + + if (selectedFiles.length < event.target.files.length) { + showMessage(`Solo se aceptan archivos ${fileExtension}`, 'warning'); + return; + } + + const filesWithSection = selectedFiles.map((file) => { + + const originalName = file.name; + const extension = originalName.split('.').pop(); + const nameWithoutExtension = originalName.replace(`.${extension}`, '') + + const newFileName = `${nameWithoutExtension}.${extension}.${seccion}`; + + // Crear nuevo objeto File con el nombre modificado + const renamedFile = new File( + [file], // Los datos del archivo + newFileName, // Nuevo nombre + { + type: file.type, + lastModified: file.lastModified + } + + ); + + return { + file: renamedFile, + originalName: originalName, + seccion: seccion + }; + + }); + + // setUploadFiles(prevFiles => [ + // ...prevFiles, + // ...filesWithSection + // ]); + + setUploadFiles(prevFiles => { + // Creamos un nuevo array reemplazando archivos existentes con misma extensión y sección + const updatedFiles = [...prevFiles]; + + filesWithSection.forEach(newFileObj => { + const index = updatedFiles.findIndex(f => + f.seccion === newFileObj.seccion + ); + + if (index !== -1) { + // Reemplazar archivo existente + updatedFiles[index] = newFileObj; + } else { + // Agregar archivo nuevo + updatedFiles.push(newFileObj); + } + }); + + return updatedFiles; + }); + + // Limpiar input para permitir re-subida del mismo archivo + }catch(error){ + showMessage(`Error durante la subida: ${error.message}`, 'error'); + }finally{ + // event.target.value = null; + } + + }; + + // Función para manejar la carga de documentos a un cove + const handleUploadToCOVE = (cove) => { + cove.tab = 'cove'; + cove.numero = cove.numero_cove; + // console.log(cove); + setSelectedDocumentForUpload(cove); + setUploadFiles([]); + setUploadModalOpen(true); + }; + + // Función para manejar la carga de documentos a un Edocument + const handleUploadToEdoc = (edoc) => { + edoc.tab = 'edoc'; + edoc.numero = edoc.numero_edocument; + // console.log(edoc); + setSelectedDocumentForUpload(edoc); + setUploadFiles([]); + setUploadModalOpen(true); + }; + + // Función para manejar la carga de documentos a un Edocument + const handleUploadFilesToDocumento = async (tab) => { + console.log(tab); + if (!selectedDocumentForUpload || uploadFiles.length === 0) { + showMessage('Por favor selecciona al menos un archivo', 'warning'); + return; + } + + setUploadingToDocumento(selectedDocumentForUpload.id); + + try{ + + const formData = new FormData(); + + // Agregar el ID del pedimento (por si acaso) + formData.append('pedimento_id', selectedDocumentForUpload.pedimento); + + // Agregar el ID de la partida + formData.append('expediente_vu_id', selectedDocumentForUpload.id); + + // Agregar archivos al FormData + // uploadFiles.forEach((file, seccion ) => { + // formData.append('files', file); + // formData.append('seccion', seccion); + // }); + uploadFiles.forEach((fileObj, index) => { + formData.append('files', fileObj.file); // Mismo nombre para todos los archivos + // Si necesitas enviar secciones para cada archivo, puedes hacerlo así: + formData.append(`secciones[${index}]`, fileObj.seccion); + }); + + if (tab === 'partida'){ + formData.append('tab_seccion', 'partida'); + formData.append('numero', selectedDocumentForUpload.numero_partida); + showMessage(`Subiendo ${uploadFiles.length} archivo(s) a la partida ${selectedDocumentForUpload.numero_partida}...`, 'info'); + }else if(tab === 'cove'){ + formData.append('tab_seccion', 'cove'); + formData.append('numero', selectedDocumentForUpload.numero_cove); + showMessage(`Subiendo ${uploadFiles.length} archivo(s) a la partida ${selectedDocumentForUpload.numero_cove}...`, 'info'); + }else if(tab === 'edoc'){ + formData.append('tab_seccion', 'edoc'); + formData.append('numero', selectedDocumentForUpload.numero_edocument); + showMessage(`Subiendo ${uploadFiles.length} archivo(s) a la partida ${selectedDocumentForUpload.numero_edocument}...`, 'info'); + }else{ + showMessage('Carga de archivos a seccion desconocida', 'error'); + return; + } + + const result = await postFormDataWithAuth(`${API_URL}/record/documents/bulk-upload-vu/`, formData); + + if(!result.ok){ + const errorData = await result.json(); + throw new Error(errorData.error || 'Error desconocido'); + } + + showMessage( + `${result.uploaded_count || uploadFiles.length} archivo(s) subido(s) exitosamente a ${tab}`, + 'success' + ); + + // // Recargar las partidas para mostrar los nuevos documentos + // fetchPedimentoPartidas(partidasPage, partidasPageSize, partidasFilters) + // .then((data) => { + // setPartidas(data.results || []); + // setPartidasCount(data.count || 0); + // }) + // .catch(err => { + // console.error('Error recargando partidas:', err); + // }); + + }catch (error){ + showMessage(`Error durante la subida: ${error.message}`, 'error'); + } finally { + + // Limpiar y cerrar + setSelectedDocumentForUpload(null); + setUploadFiles([]); + setUploadModalOpen(false) + + setUploadingToDocumento(null); + } + + }; + +const isPartida = selectedDocumentForUpload?.tab === 'partida'; +const isCove = selectedDocumentForUpload?.tab === 'cove'; +const isEdoc = selectedDocumentForUpload?.tab === 'edoc'; + //----------------------------------------// + // Estados de carga if (loading) return (
@@ -3063,7 +3567,7 @@ const handleDeleteSelectedPedimentoDocuments = async () => {
- {/* */} + {peddocuments.length > 0 && ( <> @@ -3231,7 +3735,7 @@ const handleDeleteSelectedPedimentoDocuments = async () => {
{/* Área de acciones para documentos seleccionados */} - {/* {selectedPedimentoDocuments.length > 0 && ( + {selectedPedimentos.length > 0 && (
@@ -3243,15 +3747,15 @@ const handleDeleteSelectedPedimentoDocuments = async () => {

- {selectedPedimentoDocuments.length} documento{selectedPedimentoDocuments.length !== 1 ? 's' : ''} seleccionado{selectedPedimentoDocuments.length !== 1 ? 's' : ''} + {selectedPedimentos.length} documento{selectedPedimentos.length !== 1 ? 's' : ''} seleccionado{selectedPedimentos.length !== 1 ? 's' : ''}

Selecciona una acción para continuar

- )} */} + )} {loading ? (
@@ -3311,14 +3815,14 @@ const handleDeleteSelectedPedimentoDocuments = async () => { - {/* */} + {peddocuments.map((doc, index) => ( - {/* */} +
+ -
+ handleSelectPedimentoDocument(doc.id)} + checked={selectedPedimentos.includes(doc.id)} + onChange={() => handleSelectPedimento(doc.id)} className="w-4 h-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500" /> -
@@ -3542,7 +4046,7 @@ const handleDeleteSelectedPedimentoDocuments = async () => {
{/* Botones de acción masiva */} -
+ {/*
{selectedPartidas.length > 0 && ( )} -
+
*/}
{/* Filtros */} @@ -3671,6 +4175,52 @@ const handleDeleteSelectedPedimentoDocuments = async () => { + {/* Área de acciones para documentos seleccionados */} + {selectedPartidas.length > 0 && ( +
+
+
+
+
+ + + +
+
+

+ {selectedPartidas.length} documento{selectedPartidas.length !== 1 ? 's' : ''} seleccionado{selectedPartidas.length !== 1 ? 's' : ''} +

+

Selecciona una acción para continuar

+
+
+ +
+
+
+
+ +
+
+
+ )} {partidasLoading ? (
@@ -3699,36 +4249,65 @@ const handleDeleteSelectedPedimentoDocuments = async () => {
) : (
- {/* Botón Descargar partidas y tabla de partidas */} -
- + )} +
+ {/* Botón Descargar partidas y tabla de partidas */} +
+ + const pendientes = partidas.filter(p => !p.descargado); + if (pendientes.length === 0) { + showMessage('No hay partidas pendientes por descargar', 'info'); + return; + } + let successCount = 0; + let errorCount = 0; + for (const partida of pendientes) { + try { + await handlePartidaRequest(partida); + successCount++; + } catch (error) { + errorCount++; + } + } + if (successCount > 0) showMessage(`${successCount} partida(s) procesadas exitosamente`, 'success'); + if (errorCount > 0) showMessage(`${errorCount} partida(s) no se pudieron procesar`, 'error'); + }} + > + Descargar partidas + +
@@ -3838,6 +4417,15 @@ const handleDeleteSelectedPedimentoDocuments = async () => { )} + {/* Botón para cargar documentos a la partida */} + + {/* Botón Documentos VU Partidas */}
+ {/* Área de acciones para documentos seleccionados */} + {selectedCoves.length > 0 && ( +
+
+
+
+
+ + + +
+
+

+ {selectedCoves.length} documento{selectedCoves.length !== 1 ? 's' : ''} seleccionado{selectedCoves.length !== 1 ? 's' : ''} +

+

Selecciona una acción para continuar

+
+
+ +
+
+
+
+ +
+
+
+ )} + {covesLoading ? (
@@ -4055,6 +4690,14 @@ const handleDeleteSelectedPedimentoDocuments = async () => { + @@ -4075,6 +4718,14 @@ const handleDeleteSelectedPedimentoDocuments = async () => { {coves.map((cove, index) => ( +
+ + Número COVE
+ handleSelectCove(cove.id)} + className="w-4 h-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500" + /> +
@@ -4161,6 +4812,16 @@ const handleDeleteSelectedPedimentoDocuments = async () => { )} + + {/* Botón para cargar documentos al cove */} + + {/* Botón Documentos VU COVE */}
+ {/* Área de acciones para documentos seleccionados */} + {selectedEdocs.length > 0 && ( +
+
+
+
+
+ + + +
+
+

+ {selectedEdocs.length} documento{selectedEdocs.length !== 1 ? 's' : ''} seleccionado{selectedEdocs.length !== 1 ? 's' : ''} +

+

Selecciona una acción para continuar

+
+
+ +
+
+
+
+ +
+
+
+ )} {edocsLoading ? (
@@ -4455,6 +5162,14 @@ const handleDeleteSelectedPedimentoDocuments = async () => { + @@ -4481,6 +5196,14 @@ const handleDeleteSelectedPedimentoDocuments = async () => { {edocs.map((edoc, index) => ( +
+ + Número EDocs
+ handleSelectEdoc(edoc.id)} + className="w-4 h-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500" + /> +
@@ -4575,6 +5298,16 @@ const handleDeleteSelectedPedimentoDocuments = async () => { )} + + {/* Botón para cargar documentos al cove */} + + {/* Botón Documentos VU Edocs */}
@@ -5674,6 +6410,139 @@ const handleDeleteSelectedPedimentoDocuments = async () => {
)} + {/* Modal para subir documentos */} + {uploadModalOpen && selectedDocumentForUpload && ( +
+
+
+
+

+ Subir documentos a {selectedDocumentForUpload.tab}: {selectedDocumentForUpload.numero} +

+

+ Selecciona los archivos que deseas subir +

+
+ + {/* Selectores específicos por tipo de archivo */} +
+ {/* Primer selector para COVE (XML solo para partida y cove) */} + {(isPartida || isCove) && ( +
+ +
+ {handleUploadFileSelect(e,'.xml','general')}} + className="block w-full px-3 py-2 text-sm text-gray-700 bg-white border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500" + /> +
+ Solo archivo XML (.xml) +
+
+
+ )} + + {/* Primer selector (PDF solo edoc) */} + {(isEdoc) && ( +
+ +
+ {handleUploadFileSelect(e,'.pdf','general')}} + className="block w-full px-3 py-2 text-sm text-gray-700 bg-white border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500" + /> +
+ Solo archivo PDF (.pdf) +
+
+
+ )} + + {/* Segundo selector para Acuse (PDF solo para cove y edoc) */} + {(isCove || isEdoc) && ( +
+ +
+ {handleUploadFileSelect(e,'.pdf','acuse')}} + className="block w-full px-3 py-2 text-sm text-gray-700 bg-white border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500" + /> +
+ Solo archivo PDF (.pdf) +
+
+
+ )} + + {/* Lista de archivos seleccionados */} + {/* {uploadFiles.length > 0 && ( +
+

+ Archivos seleccionados ({uploadFiles.length}) +

+
+
    + {uploadFiles.map((file, index) => ( +
  • + {file.name} + + {file.name.toLowerCase().endsWith('.xml') ? 'COVE' : + file.name.toLowerCase().endsWith('.pdf') ? 'Acuse' : 'Otro'} + +
  • + ))} +
+
+
+ )} */} +
+ +
+ + +
+
+
+
+ )} + ); } \ No newline at end of file