Prevent errors from index and paroles pages

This commit is contained in:
Cédric FAMIBELLE-PRONZOLA
2022-05-14 03:37:04 +04:00
parent c1e8960290
commit 44e0329c64
5 changed files with 130 additions and 35 deletions
+15 -3
View File
@@ -1,4 +1,5 @@
import {Container, Grid} from '@mui/material'
import PropTypes from 'prop-types'
import {Container, Grid, Typography} from '@mui/material'
import {styled} from '@mui/material/styles'
@@ -17,14 +18,25 @@ const Root = styled('div')(() => ({
}
}))
export default function DenyeTeks(denyeTeks) {
export default function DenyeTeks({denyeTeks}) {
return (
<Root className={classes.container}>
<Container>
{denyeTeks.length === 0 && (
<Container sx={{marginTop: 2}} align='center'>
<Typography sx={{fontWeight: 'bold'}} variant='h6' component='h4'>
Aucun résultat
</Typography>
</Container>
)}
<Grid container spacing={3}>
{Object.values(denyeTeks).map(t => <TeksKat key={t.id} teks={t} />)}
{denyeTeks.map(t => <TeksKat key={t.id} teks={t} />)}
</Grid>
</Container>
</Root>
)
}
DenyeTeks.propTypes = {
denyeTeks: PropTypes.array.isRequired
}
+1 -1
View File
@@ -230,7 +230,7 @@ export default function TeksDrawer({teks, anTeks, komante, denyeTeks}) {
/>
) : (
<Box sx={{marginTop: '5em'}}>
<DenyeTeks {...denyeTeks} />
<DenyeTeks denyeTeks={denyeTeks} />
</Box>
)}
</main>