import { useLocation } from "react-router-dom"; import { useMemo, ReactNode } from "react"; import { Path, SIDEBAR_ID, SlotID } from "@/app/constant"; import { getLang } from "@/app/locales"; import useMobileScreen from "@/app/hooks/useMobileScreen"; import { isIOS } from "@/app/utils"; import useListenWinResize from "@/app/hooks/useListenWinResize"; interface ScreenProps { children: ReactNode; noAuth: ReactNode; sidebar: ReactNode; } export default function Screen(props: ScreenProps) { const location = useLocation(); const isAuth = location.pathname === Path.Auth; const isMobileScreen = useMobileScreen(); const isIOSMobile = useMemo( () => isIOS() && isMobileScreen, [isMobileScreen], ); useListenWinResize(); return (
{isAuth ? ( props.noAuth ) : ( <>
{props.sidebar}
{props.children}
)}
); }