diff --git a/package-lock.json b/package-lock.json index 806366f..88757b3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,6 +17,7 @@ "react": "^19.1.0", "react-chartjs-2": "^5.3.0", "react-dom": "^19.1.0", + "react-icons": "^5.5.0", "react-router-dom": "^7.6.2", "react-window": "^1.8.11", "styled-components": "^6.1.19" @@ -2946,6 +2947,14 @@ "react": "^19.1.1" } }, + "node_modules/react-icons": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/react-icons/-/react-icons-5.5.0.tgz", + "integrity": "sha512-MEFcXdkP3dLo8uumGI5xN3lDFNsRtrjbOEKDLD7yv76v4wpnEq2Lt2qeHaQOr34I/wPN3s3+N08WkQ+CW37Xiw==", + "peerDependencies": { + "react": "*" + } + }, "node_modules/react-refresh": { "version": "0.17.0", "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.17.0.tgz", diff --git a/package.json b/package.json index 9d5233e..ba3d754 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,7 @@ "react": "^19.1.0", "react-chartjs-2": "^5.3.0", "react-dom": "^19.1.0", + "react-icons": "^5.5.0", "react-router-dom": "^7.6.2", "react-window": "^1.8.11", "styled-components": "^6.1.19" diff --git a/src/pages/Datastage.jsx b/src/pages/Datastage.jsx index 363a1d9..5f45f2d 100644 --- a/src/pages/Datastage.jsx +++ b/src/pages/Datastage.jsx @@ -128,6 +128,7 @@ export default function Datastage() { const [loading, setLoading] = useState(false); const [error, setError] = useState(null); const [form, setForm] = useState({ archivo: null, contribuyente: '' }); + const [importadores, setImportadores] = useState([]); const [editingId, setEditingId] = useState(null); const [showCreateModal, setShowCreateModal] = useState(false); const [showEditModal, setShowEditModal] = useState(false); @@ -256,9 +257,21 @@ export default function Datastage() { }; // Abrir modal de creación - const openCreateModal = () => { + const openCreateModal = async () => { setForm({ archivo: null, contribuyente: '' }); setEditingId(null); + // Fetch importadores + try { + const res = await fetchWithAuth(`${import.meta.env.VITE_EFC_API_URL}/customs/importadores/`, { method: 'GET' }); + const data = await res.json(); + if (Array.isArray(data)) { + setImportadores(data); + } else { + setImportadores([]); + } + } catch { + setImportadores([]); + } setShowCreateModal(true); }; @@ -563,43 +576,132 @@ export default function Datastage() { {/* Modal de creación - estilo Users/Importers */} {showCreateModal && (