2026-06-08 21:46:18 +04:00
|
|
|
|
'use client'
|
|
|
|
|
|
|
|
|
|
|
|
import PropTypes from 'prop-types'
|
|
|
|
|
|
import Card from '@mui/material/Card'
|
|
|
|
|
|
import CardActionArea from '@mui/material/CardActionArea'
|
|
|
|
|
|
import CardContent from '@mui/material/CardContent'
|
|
|
|
|
|
import Typography from '@mui/material/Typography'
|
|
|
|
|
|
import Box from '@mui/material/Box'
|
|
|
|
|
|
import Chip from '@mui/material/Chip'
|
2026-06-22 14:52:07 +04:00
|
|
|
|
import Image from 'next/image'
|
2026-06-08 21:46:18 +04:00
|
|
|
|
import Link from 'next/link'
|
|
|
|
|
|
|
|
|
|
|
|
import {getAlias} from '../../lib/utils/format'
|
|
|
|
|
|
import {formatKuveti} from '../../lib/kuveti'
|
|
|
|
|
|
|
|
|
|
|
|
const IMAGE_URL = process.env.NEXT_PUBLIC_API_URL_ROOT || 'http://localhost:1337'
|
2026-06-22 14:52:07 +04:00
|
|
|
|
|
|
|
|
|
|
// 1×1 gris neutre — placeholder pendant le chargement
|
|
|
|
|
|
const BLUR_DATA_URL = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNsYAAAAAYAAjCB0C8AAAAASUVORK5CYII='
|
2026-06-08 21:46:18 +04:00
|
|
|
|
|
|
|
|
|
|
export default function AnVedette({teks}) {
|
|
|
|
|
|
const {titre, artistes, annee, couverture, slug} = teks
|
|
|
|
|
|
const aliases = getAlias(artistes, teks.prioriteArtistes)
|
2026-06-22 10:13:02 +04:00
|
|
|
|
const fmt = formatKuveti(couverture, 'medium')
|
2026-06-08 21:46:18 +04:00
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
|
<Box sx={{mb: 4}}>
|
|
|
|
|
|
<Chip
|
2026-06-11 21:17:17 +04:00
|
|
|
|
label='NEW RELEASE'
|
2026-06-08 21:46:18 +04:00
|
|
|
|
size='small'
|
|
|
|
|
|
color='primary'
|
|
|
|
|
|
sx={{mb: 1.5, fontWeight: 'bold', letterSpacing: 1}}
|
|
|
|
|
|
/>
|
|
|
|
|
|
<Card sx={{borderRadius: 2, overflow: 'hidden'}}>
|
|
|
|
|
|
<CardActionArea component={Link} href={`/paroles/${slug}`}>
|
2026-06-22 08:57:24 +04:00
|
|
|
|
<Box sx={{position: 'relative', width: '100%', aspectRatio: {xs: '1 / 1', sm: '16 / 9'}, maxHeight: {sm: 420}}}>
|
2026-06-22 14:52:07 +04:00
|
|
|
|
{fmt?.url ? (
|
|
|
|
|
|
<Image
|
|
|
|
|
|
src={`${IMAGE_URL}${fmt.url}`}
|
|
|
|
|
|
alt={titre}
|
|
|
|
|
|
fill
|
|
|
|
|
|
priority
|
|
|
|
|
|
placeholder='blur'
|
|
|
|
|
|
blurDataURL={BLUR_DATA_URL}
|
|
|
|
|
|
sizes='(max-width: 600px) 100vw, 800px'
|
|
|
|
|
|
style={{objectFit: 'cover'}}
|
2026-06-22 08:57:24 +04:00
|
|
|
|
/>
|
2026-06-22 14:52:07 +04:00
|
|
|
|
) : (
|
|
|
|
|
|
<Box sx={{width: '100%', height: '100%', bgcolor: 'grey.300'}} />
|
2026-06-22 08:57:24 +04:00
|
|
|
|
)}
|
|
|
|
|
|
</Box>
|
2026-06-08 21:46:18 +04:00
|
|
|
|
<CardContent>
|
|
|
|
|
|
<Typography variant='h5' component='h2' sx={{fontWeight: 'bold', mb: 0.5}}>
|
|
|
|
|
|
{titre}
|
|
|
|
|
|
</Typography>
|
|
|
|
|
|
<Typography variant='body1' color='text.secondary'>
|
|
|
|
|
|
{aliases}
|
|
|
|
|
|
</Typography>
|
|
|
|
|
|
{annee && (
|
|
|
|
|
|
<Typography variant='body2' color='text.secondary'>
|
|
|
|
|
|
{annee}
|
|
|
|
|
|
</Typography>
|
|
|
|
|
|
)}
|
|
|
|
|
|
</CardContent>
|
|
|
|
|
|
</CardActionArea>
|
|
|
|
|
|
</Card>
|
|
|
|
|
|
</Box>
|
|
|
|
|
|
)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
AnVedette.propTypes = {
|
|
|
|
|
|
teks: PropTypes.object.isRequired
|
|
|
|
|
|
}
|