'use client'; import { FunctionComponent, PropsWithChildren, useEffect } from 'react'; import { useTranslations } from 'next-intl'; import { LinkToPage } from '@/utils'; import { COOKIE_NAMES } from '@/lib/cookies'; import { getClientCookie } from '@/lib/cookies/client'; import { useAppStore } from '@/store'; import TopBarAndSideBarLayout from './TopBarAndSideBarLayout'; /** * Renders "Private Layout" composition * @layout PrivateLayout */ const PrivateLayout: FunctionComponent = ({ children }) => { const t = useTranslations('nav'); const [, dispatch] = useAppStore(); useEffect(() => { if (getClientCookie(COOKIE_NAMES.ACCESS_TOKEN)) { dispatch({ type: 'LOG_IN' }); } }, [dispatch]); const sidebarItems: Array = [ { title: t('home'), path: '/', icon: 'home' }, { title: '404', path: '/wrong-url', icon: 'error' }, ]; return ( {children} {/* Copyright © */} ); }; export default PrivateLayout;