2023-07-22 13:11:56 +04:00
|
|
|
import {notFound} from 'next/navigation'
|
|
|
|
|
import Box from '@mui/material/Box'
|
|
|
|
|
import Container from '@mui/material/Container'
|
2024-10-21 09:55:57 +04:00
|
|
|
import Grid from '@mui/material/Grid2'
|
2023-07-22 13:11:56 +04:00
|
|
|
|
|
|
|
|
import ChecheAwtis from '../../components/awtis/cheche-awtis'
|
|
|
|
|
import AwtisKat from '../../components/awtis/awtis-kat'
|
|
|
|
|
import Pajinasyon from '../../components/awtis/pajinasyon'
|
|
|
|
|
|
|
|
|
|
import {jwennAwtisPajinasyon} from '../../lib/oki-api'
|
2023-07-23 10:28:43 +04:00
|
|
|
import Footer from '../../components/footer'
|
2023-07-22 13:11:56 +04:00
|
|
|
|
|
|
|
|
export const metadata = {
|
|
|
|
|
title: 'OKI | Awtis - Liste des artistes',
|
|
|
|
|
description: 'Liste des artistes ayant une ou plusieurs œuvres présentes sur le site.',
|
|
|
|
|
openGraph: {
|
|
|
|
|
title: 'OKI | Awtis - Liste des artistes',
|
|
|
|
|
description: 'Liste des artistes ayant une ou plusieurs œuvres présentes sur le site.',
|
|
|
|
|
url: 'https://oki.re/sipote',
|
2024-06-01 20:23:46 +04:00
|
|
|
siteName: 'OKI | ORGANISATION KA INTERNATIONALE. Paroles et traductions.',
|
2023-07-22 13:11:56 +04:00
|
|
|
images: [
|
|
|
|
|
{
|
2023-08-09 17:21:42 +04:00
|
|
|
url: 'https://oki.re/logo-512x512.png',
|
2023-07-22 13:11:56 +04:00
|
|
|
width: 512,
|
|
|
|
|
height: 512
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
locale: 'fr_FR',
|
|
|
|
|
type: 'website'
|
|
|
|
|
},
|
|
|
|
|
twitter: {
|
|
|
|
|
site: '@OrganisationKA',
|
|
|
|
|
card: 'summary_large_image',
|
|
|
|
|
title: 'OKI | Awtis - Liste des artistes',
|
|
|
|
|
description: 'Liste des artistes ayant une ou plusieurs œuvres présentes sur le site.',
|
|
|
|
|
creator: '@OrganisationKA',
|
|
|
|
|
images: {
|
|
|
|
|
url: 'https://oki.re/logo-512x512.png',
|
|
|
|
|
alt: 'OKI Logo',
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async function jwennDone(paj) {
|
|
|
|
|
const pajParsed = Array.isArray(paj) ? Number.parseInt(paj[1], 10) : Number.parseInt(paj, 10)
|
|
|
|
|
|
|
|
|
|
if (Number.isNaN(pajParsed)) {
|
|
|
|
|
notFound()
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-21 19:16:11 +04:00
|
|
|
const {data, meta} = await jwennAwtisPajinasyon(pajParsed)
|
|
|
|
|
const pajTotal = Math.ceil(meta.pagination.total / meta.pagination.limit)
|
2023-07-22 13:11:56 +04:00
|
|
|
|
|
|
|
|
if (pajParsed > pajTotal || pajParsed < 1) {
|
|
|
|
|
notFound()
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-21 19:16:11 +04:00
|
|
|
return {pajTotal, awtisPouChakPaj: data, pajParsed}
|
2023-07-22 13:11:56 +04:00
|
|
|
}
|
|
|
|
|
|
2026-04-16 12:52:51 +04:00
|
|
|
export default async function AwitsPaj(props) {
|
|
|
|
|
const searchParams = await props.searchParams;
|
2023-07-22 13:11:56 +04:00
|
|
|
const {paj} = searchParams
|
|
|
|
|
const {pajTotal, awtisPouChakPaj, pajParsed} = await jwennDone(paj || 1)
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<Box sx={{display: 'flex', flexDirection: 'column', minHeight: '100vh'}}>
|
|
|
|
|
<Pajinasyon pajTotal={pajTotal} paj={pajParsed} />
|
|
|
|
|
<ChecheAwtis />
|
|
|
|
|
<Container sx={{marginBottom: 5, flexGrow: 100}}>
|
|
|
|
|
<Grid container spacing={{xs: 2, md: 3}}>
|
2026-04-21 19:16:11 +04:00
|
|
|
{awtisPouChakPaj.map(artiste => <AwtisKat key={artiste.id} artiste={artiste} />)}
|
2023-07-22 13:11:56 +04:00
|
|
|
</Grid>
|
|
|
|
|
</Container>
|
2023-07-23 10:28:43 +04:00
|
|
|
<Footer />
|
2023-07-22 13:11:56 +04:00
|
|
|
</Box>
|
|
|
|
|
)
|
|
|
|
|
}
|