// @ts-nocheck
import React, { FC } from 'react';
import { Route, Switch } from 'wouter';

import { useAuth } from '@prokyon/auth/hook/useAuth';
import Section from '@prokyon/components/Section';
import { Skeleton } from '@prokyon/components/Skeleton';
import { MenuItem } from '@prokyon/components/Skeleton/types';

import { WelcomePage } from 'pages/WelcomePage';

import { buildRoute, Routes } from './routes';

const topMenu: MenuItem[][] = [
	[
        { label: 'Routa', href: buildRoute('root') },
	],
	[
		// authenticated
	],
];

const userMenu: MenuItem[][] = [
	[
		// public
	],
	[
		// authenticated
	],
];

export const App: FC = () => {
	const { authenticated } = useAuth();

	return (
		<Skeleton	
			items={{
				logo: <>Many</>,
				top: authenticated ? topMenu[1] : topMenu[0],
				user: authenticated ? userMenu[1] : userMenu[0],
			}}
			components={{
				footer: (
					<div className="text-center footer">
						<Section>
							Tento web používá pouze technické cookie. Monitorování návštěvnosti je zcela anonymní a je prováděno na straně
							provozovatele webu.
						</Section>
					</div>
				)
			}}
			>
			{authenticated ? (
				<Switch>
					<Route>404!</Route>
				</Switch>
			) : (
				<Switch>
					<Route path={Routes.root} component={WelcomePage} />
					<Route>404!</Route>
				</Switch>
			)}
		</Skeleton>
	);
};

