/** * Copyright (C) 2019-2021 Carl Kittelberger * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ import * as React from 'react'; import Head from 'next/head'; import Link from 'next/link'; import ListGroup from 'react-bootstrap/ListGroup'; import { Breadcrumb } from 'react-bootstrap'; import { useIntl } from 'react-intl'; import { FormattedMessage } from '../components/localization'; import { VideoOnDemandIndex } from '../util/datatypes/VideoOnDemandIdentifier'; import { getIndex } from '../util/api'; import { GetServerSideProps, NextPage } from 'next'; interface HomeProps { index: VideoOnDemandIndex } export const getServerSideProps: GetServerSideProps = async () => { // Fetch VOD IDs and announcements return { props: { index: await getIndex(), }, }; } const Home: NextPage = ({ index: { announcements, ids } }) => { const intl = useIntl(); return (
{intl.formatMessage({ id: 'App.title', description: 'The full title of the website', defaultMessage: 'Games Done Quick Instant Archive', })}

{ announcements.map((text, id) => (

Announcement: {text}

)) } {ids.map(({ id, title }) => (
{title}
))}
); } export default Home;