Restore frontend
This commit is contained in:
@@ -2,9 +2,6 @@ import React, { useState } from 'react';
|
||||
import { useDashboard } from '../../hooks/useDashboard';
|
||||
import { useOrderSuggestions } from '../../hooks/useOrderSuggestions';
|
||||
|
||||
// Import enhanced dashboard components
|
||||
import { EnhancedDashboard } from '../../components/dashboard/EnhancedDashboard';
|
||||
|
||||
// Import simplified components for fallback
|
||||
import TodayRevenue from '../../components/simple/TodayRevenue';
|
||||
import TodayProduction from '../../components/simple/TodayProduction';
|
||||
@@ -30,7 +27,6 @@ const DashboardPage: React.FC<DashboardPageProps> = ({
|
||||
onNavigateToRecipes,
|
||||
onNavigateToSales
|
||||
}) => {
|
||||
const [useEnhancedView, setUseEnhancedView] = useState(true);
|
||||
const {
|
||||
weather,
|
||||
tenantId,
|
||||
@@ -82,38 +78,6 @@ const DashboardPage: React.FC<DashboardPageProps> = ({
|
||||
return 'Buenas noches';
|
||||
};
|
||||
|
||||
// Toggle between enhanced and classic view
|
||||
const toggleDashboardView = () => {
|
||||
setUseEnhancedView(!useEnhancedView);
|
||||
};
|
||||
|
||||
// Show enhanced dashboard by default - use debug version for stability
|
||||
if (useEnhancedView) {
|
||||
return (
|
||||
<div>
|
||||
{/* Dashboard View Toggle */}
|
||||
<div className="fixed top-4 right-4 z-50 flex space-x-2">
|
||||
<button
|
||||
onClick={toggleDashboardView}
|
||||
className="px-3 py-1 text-xs bg-blue-600 text-white rounded-full hover:bg-blue-700 transition-colors shadow-lg"
|
||||
title="Cambiar a vista clásica"
|
||||
>
|
||||
Vista Clásica
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<EnhancedDashboard
|
||||
onNavigateToOrders={onNavigateToOrders}
|
||||
onNavigateToReports={onNavigateToReports}
|
||||
onNavigateToProduction={onNavigateToProduction}
|
||||
onNavigateToInventory={onNavigateToInventory}
|
||||
onNavigateToRecipes={onNavigateToRecipes}
|
||||
onNavigateToSales={onNavigateToSales}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
// Classic dashboard view
|
||||
if (isLoading) {
|
||||
return (
|
||||
@@ -143,17 +107,7 @@ const DashboardPage: React.FC<DashboardPageProps> = ({
|
||||
|
||||
return (
|
||||
<div className="p-4 md:p-6 space-y-6 bg-gray-50 min-h-screen">
|
||||
{/* Dashboard View Toggle */}
|
||||
<div className="fixed top-4 right-4 z-50">
|
||||
<button
|
||||
onClick={toggleDashboardView}
|
||||
className="px-3 py-1 text-xs bg-gray-600 text-white rounded-full hover:bg-gray-700 transition-colors shadow-lg"
|
||||
title="Cambiar a vista mejorada"
|
||||
>
|
||||
Vista Mejorada
|
||||
</button>
|
||||
</div>
|
||||
|
||||
|
||||
{/* Welcome Header */}
|
||||
<div className="bg-white rounded-xl shadow-sm border border-gray-200 p-6">
|
||||
<div className="flex flex-col sm:flex-row sm:items-center sm:justify-between">
|
||||
|
||||
Reference in New Issue
Block a user