import { Link as LinkIcon } from '@mui/icons-material'; import { Button } from '@mui/material'; import type { GetStaticProps, NextPage } from 'next'; import Image from 'next/image'; import Link from 'next/link'; import { Trans, useTranslation } from 'next-i18next'; import { serverSideTranslations } from 'next-i18next/serverSideTranslations'; import Footer from '@/components/shared/Footer'; import Logo from '@/components/shared/Logo'; import NoSSR from '@/components/shared/NoSSR'; import { screenshots } from '@/config/screenshots'; import { logout } from '@/store/auth/authSlice'; import { useAppDispatch, useAppSelector } from '@/store/hooks'; import { setModalState } from '@/store/modal/modalSlice'; import styles from '@/styles/pages/Home.module.scss'; import { DONATION_URL, GITHUB_URL } from '../constants'; export const getStaticProps: GetStaticProps = async ({ locale = 'en' }) => { return { props: { ...(await serverSideTranslations(locale, ['common', 'modals', 'landing'])), }, }; }; const Home: NextPage = () => { const { t } = useTranslation(); const dispatch = useAppDispatch(); const isLoggedIn = useAppSelector((state) => state.auth.isLoggedIn); const handleLogin = () => dispatch(setModalState({ modal: 'auth.login', state: { open: true } })); const handleRegister = () => dispatch(setModalState({ modal: 'auth.register', state: { open: true } })); const handleLogout = () => dispatch(logout()); return (

{t('common.title')}

{t('common.subtitle')}

{isLoggedIn ? ( <> ) : ( <> )}
{t('landing.summary.heading')}

{t('landing.summary.body')}

{t('landing.features.heading')}
{t('landing.screenshots.heading')}
{screenshots.map(({ src, alt }) => ( {alt} ))}
{t('landing.links.heading')}
); }; export default Home;