import Header from '@/Components/Header'
import Sidebar from '@/Components/Sidebar'

import { router } from '@inertiajs/react'
import { useEffect } from 'react';

export default function Layout({ children }) {
    useEffect(() => {
        const interval = setInterval(() => {
          router.reload();
        }, 30000);
    
        return () => clearInterval(interval);
    }, []);
    return (
        <div dir="rtl" className="w-screen h-screen flex flex-row bg-gray-200">
            <div className="h-full w-fit hidden md:flex">
                <Sidebar />
            </div>
            <div className="flex flex-col space-y-12 h-full w-full p-8 px-12 overflow-auto" >
                <Header />
                {children} 
            </div>
        </div>
    );
}