Fix new services implementation 11

This commit is contained in:
Urtzi Alfaro
2025-08-16 08:43:35 +02:00
parent 119beb541f
commit 995a51e285
8 changed files with 114 additions and 71 deletions

View File

@@ -15,15 +15,22 @@ interface DashboardPageProps {
onNavigateToOrders?: () => void;
onNavigateToReports?: () => void;
onNavigateToProduction?: () => void;
onNavigateToInventory?: () => void;
onNavigateToRecipes?: () => void;
onNavigateToSales?: () => void;
}
const DashboardPage: React.FC<DashboardPageProps> = ({
onNavigateToOrders,
onNavigateToReports,
onNavigateToProduction
onNavigateToProduction,
onNavigateToInventory,
onNavigateToRecipes,
onNavigateToSales
}) => {
const {
weather,
tenantId,
isLoading,
error,
reload,
@@ -31,13 +38,13 @@ const DashboardPage: React.FC<DashboardPageProps> = ({
metrics
} = useDashboard();
// Use real API data for order suggestions
// Use real API data for order suggestions - pass tenantId from dashboard
const {
dailyOrders: realDailyOrders,
weeklyOrders: realWeeklyOrders,
isLoading: ordersLoading,
error: ordersError
} = useOrderSuggestions();
} = useOrderSuggestions(tenantId);
// Debug order suggestions
console.log('📈 Dashboard: OrderSuggestions data:', {