import React, { useState, useEffect } from 'react'; import { Box, useTheme, useMediaQuery } from '@mui/material'; import KitchPlusAppBar from '../AppBar'; import Sidebar from '../SideHome'; import LoginRestaurant from './contcet/LoginRestaurant'; import BasicInformation from './contcet/BasicInformation'; import ContactInformation from './contcet/ContactInformation'; import BusinessHours from './contcet/BusinessHours'; import UploadMenu from './contcet/UploadMenu'; import Equipment from './contcet/Equipment'; import TypeOfRestaurant from './contcet/TypeOfRestaurant'; import OperationalCapacity from './contcet/OperationalCapacity'; import UploadPhotos from './contcet/UploadPhotos'; import SideProfile from './SideProfile'; const drawerWidth = 230; const RestaurantProfile = () => { 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)} />, setCurrentStep(currentStep + 1)} onBack={() => setCurrentStep(currentStep - 1)} />, setCurrentStep(currentStep + 1)} onBack={() => setCurrentStep(currentStep - 1)} />, 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 RestaurantProfile;