Files
warframe-center/frontend/pages/home/index.js

31 lines
665 B
JavaScript

import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
import { models } from 'shared-stuff'
import dbConnect from '../../lib/dbConnect'
import Hero from './Hero'
import Table from './Table'
export default function Home ({ scanResults }) {
return (
<>
<Hero />
<Table
scanResults={scanResults}
/>
</>
)
}
export async function getServerSideProps ({ locale }) {
await dbConnect()
const scanResults = await models.ScanResult.find({})
return {
props: {
scanResults: JSON.parse(JSON.stringify(scanResults)),
...(await serverSideTranslations(locale, ['common', 'home']))
}
}
}