'use client' import Link from "next/link"; import React, { useEffect, useState } from "react"; import { useRouter } from "next/navigation"; const AdminDashBoardMain = () => { const router = useRouter() // const params = useParams(); // const restaurantbranch = params?.restaurantbranch; // const RestaruntBranch = restaurantbranch const [restaruntBranch, setRestaruntBranch] = useState("") useEffect(() => { const restarunt = localStorage.getItem("restaurantbranch") setRestaruntBranch(restarunt) }, []) useEffect(() => { const isLogin = JSON.parse(localStorage.getItem("isLogin")); if (!isLogin) { router.push(`/admin?restaurantbranch=${restaruntBranch}`); } }, [router]); return (