Se oculto reporte de minimos y de coves

This commit is contained in:
2025-10-01 21:38:35 -06:00
parent c8ad7b4fa7
commit 97672b03d7

View File

@@ -34,6 +34,9 @@ if (typeof document !== 'undefined' && !document.getElementById('reports-animati
} }
export default function Reports() { export default function Reports() {
// Leer DEBUG_MODE desde variables de entorno
const isDebugMode = import.meta.env.VITE_DEBUG_MODE === 'true';
const [isExporting, setIsExporting] = useState(false); const [isExporting, setIsExporting] = useState(false);
const [exportFormat, setExportFormat] = useState('excel'); const [exportFormat, setExportFormat] = useState('excel');
const [showExportSuccess, setShowExportSuccess] = useState(false); const [showExportSuccess, setShowExportSuccess] = useState(false);
@@ -44,6 +47,14 @@ export default function Reports() {
// Estado para pestañas // Estado para pestañas
const [activeTab, setActiveTab] = useState('pedimentos'); const [activeTab, setActiveTab] = useState('pedimentos');
// Efecto para manejar el cambio de pestaña cuando isDebugMode cambia
useEffect(() => {
// Si no está en modo debug y la pestaña activa es una pestaña de debug, cambiar a 'pedimentos'
if (!isDebugMode && (activeTab === 'minimos' || activeTab === 'coves')) {
setActiveTab('pedimentos');
}
}, [isDebugMode, activeTab]);
// Importar modelos // Importar modelos
const datastageModels = datastageModelsData?.models || []; const datastageModels = datastageModelsData?.models || [];
const pedimentosModels = pedimentosModelsData?.models || []; const pedimentosModels = pedimentosModelsData?.models || [];
@@ -807,36 +818,40 @@ export default function Reports() {
<span>Datastage cargados</span> <span>Datastage cargados</span>
</div> </div>
</button> </button>
<button {isDebugMode && (
className={`flex-1 py-3 px-4 text-sm font-semibold rounded-xl focus:outline-none transition-all duration-200 ${ <button
activeTab === 'minimos' className={`flex-1 py-3 px-4 text-sm font-semibold rounded-xl focus:outline-none transition-all duration-200 ${
? 'bg-gradient-to-br from-blue-600 to-blue-700 text-white shadow-lg shadow-blue-500/20 scale-[1.02]' activeTab === 'minimos'
: 'text-gray-700 hover:bg-blue-50/80' ? 'bg-gradient-to-br from-blue-600 to-blue-700 text-white shadow-lg shadow-blue-500/20 scale-[1.02]'
}`} : 'text-gray-700 hover:bg-blue-50/80'
onClick={() => setActiveTab('minimos')} }`}
> onClick={() => setActiveTab('minimos')}
<div className="flex items-center justify-center gap-2"> >
<svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"> <div className="flex items-center justify-center gap-2">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M9 7h6m0 10v-3m-3 3h.01M9 17h.01M9 14h.01M12 14h.01M15 11h.01M12 11h.01M9 11h.01M7 21h10a2 2 0 002-2V5a2 2 0 00-2-2H7a2 2 0 00-2 2v14a2 2 0 002 2z" /> <svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
</svg> <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M9 7h6m0 10v-3m-3 3h.01M9 17h.01M9 14h.01M12 14h.01M15 11h.01M12 11h.01M9 11h.01M7 21h10a2 2 0 002-2V5a2 2 0 00-2-2H7a2 2 0 00-2 2v14a2 2 0 002 2z" />
<span>Mínimos</span> </svg>
</div> <span>Mínimos</span>
</button> </div>
<button </button>
className={`flex-1 py-3 px-4 text-sm font-semibold rounded-xl focus:outline-none transition-all duration-200 ${ )}
activeTab === 'coves' {isDebugMode && (
? 'bg-gradient-to-br from-blue-600 to-blue-700 text-white shadow-lg shadow-blue-500/20 scale-[1.02]' <button
: 'text-gray-700 hover:bg-blue-50/80' className={`flex-1 py-3 px-4 text-sm font-semibold rounded-xl focus:outline-none transition-all duration-200 ${
}`} activeTab === 'coves'
onClick={() => setActiveTab('coves')} ? 'bg-gradient-to-br from-blue-600 to-blue-700 text-white shadow-lg shadow-blue-500/20 scale-[1.02]'
> : 'text-gray-700 hover:bg-blue-50/80'
<div className="flex items-center justify-center gap-2"> }`}
<svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"> onClick={() => setActiveTab('coves')}
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M8 7v8a2 2 0 002 2h6M8 7V5a2 2 0 012-2h4.586a1 1 0 01.707.293l4.414 4.414a1 1 0 01.293.707V15a2 2 0 01-2 2h-2M8 7H6a2 2 0 00-2 2v10a2 2 0 002 2h8a2 2 0 002-2v-2" /> >
</svg> <div className="flex items-center justify-center gap-2">
<span>COVES</span> <svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
</div> <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M8 7v8a2 2 0 002 2h6M8 7V5a2 2 0 012-2h4.586a1 1 0 01.707.293l4.414 4.414a1 1 0 01.293.707V15a2 2 0 01-2 2h-2M8 7H6a2 2 0 00-2 2v10a2 2 0 002 2h8a2 2 0 002-2v-2" />
</button> </svg>
<span>COVES</span>
</div>
</button>
)}
</div> </div>
{/* Contenido de la pestaña activa */} {/* Contenido de la pestaña activa */}
<div>{tabContents[activeTab]}</div> <div>{tabContents[activeTab]}</div>