Se oculto reporte de minimos y de coves
This commit is contained in:
@@ -34,6 +34,9 @@ if (typeof document !== 'undefined' && !document.getElementById('reports-animati
|
||||
}
|
||||
|
||||
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 [exportFormat, setExportFormat] = useState('excel');
|
||||
const [showExportSuccess, setShowExportSuccess] = useState(false);
|
||||
@@ -44,6 +47,14 @@ export default function Reports() {
|
||||
// Estado para pestañas
|
||||
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
|
||||
const datastageModels = datastageModelsData?.models || [];
|
||||
const pedimentosModels = pedimentosModelsData?.models || [];
|
||||
@@ -807,36 +818,40 @@ export default function Reports() {
|
||||
<span>Datastage cargados</span>
|
||||
</div>
|
||||
</button>
|
||||
<button
|
||||
className={`flex-1 py-3 px-4 text-sm font-semibold rounded-xl focus:outline-none transition-all duration-200 ${
|
||||
activeTab === 'minimos'
|
||||
? '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')}
|
||||
>
|
||||
<div className="flex items-center justify-center gap-2">
|
||||
<svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<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>
|
||||
<span>Mínimos</span>
|
||||
</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'
|
||||
? '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('coves')}
|
||||
>
|
||||
<div className="flex items-center justify-center gap-2">
|
||||
<svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<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>
|
||||
<span>COVES</span>
|
||||
</div>
|
||||
</button>
|
||||
{isDebugMode && (
|
||||
<button
|
||||
className={`flex-1 py-3 px-4 text-sm font-semibold rounded-xl focus:outline-none transition-all duration-200 ${
|
||||
activeTab === 'minimos'
|
||||
? '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')}
|
||||
>
|
||||
<div className="flex items-center justify-center gap-2">
|
||||
<svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<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>
|
||||
<span>Mínimos</span>
|
||||
</div>
|
||||
</button>
|
||||
)}
|
||||
{isDebugMode && (
|
||||
<button
|
||||
className={`flex-1 py-3 px-4 text-sm font-semibold rounded-xl focus:outline-none transition-all duration-200 ${
|
||||
activeTab === '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'
|
||||
}`}
|
||||
onClick={() => setActiveTab('coves')}
|
||||
>
|
||||
<div className="flex items-center justify-center gap-2">
|
||||
<svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<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>
|
||||
<span>COVES</span>
|
||||
</div>
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
{/* Contenido de la pestaña activa */}
|
||||
<div>{tabContents[activeTab]}</div>
|
||||
|
||||
Reference in New Issue
Block a user