Files
pawol.nu/app/page.js
T

41 lines
1.2 KiB
JavaScript
Raw Normal View History

2026-06-17 09:20:11 +04:00
export const dynamic = 'force-dynamic'
2023-07-22 13:02:11 +04:00
import Box from '@mui/material/Box'
import Container from '@mui/material/Container'
import {notFound} from 'next/navigation'
2026-06-17 08:51:06 +04:00
import {jwennStats, jwennDenyeTeks, jwennAnVedette} from '../lib/oki-api'
2023-07-22 13:02:11 +04:00
import Statistik from '../components/akey/statistik'
import Akey from '../components/akey'
2026-06-08 21:46:18 +04:00
import AnVedette from '../components/akey/an-vedette'
2023-07-22 13:02:11 +04:00
import okiLogo from '../public/logo-512x512.png'
2023-07-23 10:28:43 +04:00
import Footer from '../components/footer'
2023-11-06 19:12:35 +04:00
import Aso from '../components/akey/aso'
2023-07-22 13:02:11 +04:00
async function jwennDone() {
2026-06-17 08:51:06 +04:00
const [statistik, denyeTeks, anVedette] = await Promise.all([jwennStats(), jwennDenyeTeks(), jwennAnVedette()])
2023-07-22 13:02:11 +04:00
if (!statistik) {
notFound()
}
2026-06-17 08:51:06 +04:00
return {statistik, dernierTeks: anVedette ?? denyeTeks?.[0]}
2023-07-22 13:02:11 +04:00
}
export default async function Page() {
2026-06-08 21:46:18 +04:00
const {statistik, dernierTeks} = await jwennDone()
2023-07-22 13:02:11 +04:00
return (
<Box sx={{display: 'flex', flexDirection: 'column', minHeight: '100vh'}}>
<Akey logo={okiLogo} />
<Container sx={{flexGrow: 100}}>
2026-06-08 21:46:18 +04:00
{dernierTeks && <AnVedette teks={dernierTeks} />}
2023-07-22 13:02:11 +04:00
<Statistik statistik={statistik} />
2023-11-06 19:12:35 +04:00
<Aso />
2023-07-22 13:02:11 +04:00
</Container>
2023-07-23 10:28:43 +04:00
<Footer />
2023-07-22 13:02:11 +04:00
</Box>
)
}