import React, { useState, useEffect } from 'react'; import { Box, useTheme, useMediaQuery } from '@mui/material'; import KitchPlusAppBar from '../AppBar'; import Sidebar from '../SideHome'; import PostSubmission from './contcet/PostSubmission'; import CloudKitchenHosting from './contcet/CloudKitchenHosting'; import Infrastructure from './contcet/Infrastructure'; import RstaurantOperations from './contcet/RstaurantOperations'; import Facilitation from './contcet/Facilitation'; import Expansion from './contcet/Expansion'; import SideProfile from './SideProfile'; const drawerWidth = 230; const HostKitchen = () => { const theme = useTheme(); const isMobile = useMediaQuery(theme.breakpoints.down('sm')); const [hasProducts, setHasProducts] = useState(false); const [sidebarOpen, setSidebarOpen] = useState(!isMobile); // ⬇️ إدارة الخطوة الحالية const [currentStep, setCurrentStep] = useState(0); const steps = [ setCurrentStep(currentStep + 1)} onBack={() => setCurrentStep(currentStep - 1)} />, setCurrentStep(currentStep + 1)} onBack={() => setCurrentStep(currentStep - 1)} />, setCurrentStep(currentStep + 1)} onBack={() => setCurrentStep(currentStep - 1)} />, setCurrentStep(currentStep + 1)} onBack={() => setCurrentStep(currentStep - 1)} />, setCurrentStep(currentStep + 1)} onBack={() => setCurrentStep(currentStep - 1)} />, ]; useEffect(() => { const checkProducts = async () => { const productsExist = await checkIfProductsExist(); setHasProducts(productsExist); }; checkProducts(); }, []); const checkIfProductsExist = async () => { return false; }; useEffect(() => { if (window.innerWidth >= theme.breakpoints.values.md) { setSidebarOpen(true); } else { setSidebarOpen(false); } }, [theme.breakpoints.values.md]); useEffect(() => { const handleResize = () => { if (window.innerWidth >= theme.breakpoints.values.md) { setSidebarOpen(true); } else { setSidebarOpen(false); } }; handleResize(); window.addEventListener('resize', handleResize); return () => window.removeEventListener('resize', handleResize); }, [theme.breakpoints.values.md]); const handleDrawerToggle = () => { setSidebarOpen(!sidebarOpen); }; return ( {/* */} setCurrentStep(prev => Math.max(prev - 1, 0))} /> {steps[currentStep]} ); }; export default HostKitchen;