-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a534ba5
commit 1f56e0a
Showing
3 changed files
with
81 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import React, { useContext } from 'react'; | ||
|
||
import Button from '@mui/material/Button'; | ||
import Card from '@mui/material/Card'; | ||
import CardActions from '@mui/material/CardActions'; | ||
import CardContent from '@mui/material/CardContent'; | ||
import CardMedia from '@mui/material/CardMedia'; | ||
import Typography from '@mui/material/Typography'; | ||
|
||
import MediathequeContext from 'src/contexts/mediathequeContext'; | ||
|
||
export default function MediaCard() { | ||
const { filtered } = useContext(MediathequeContext); | ||
const { allFiltered } = useContext(MediathequeContext); | ||
console.log('filtered'); | ||
|
||
console.log(filtered); | ||
console.log('allFiltered'); | ||
|
||
console.log(allFiltered); | ||
|
||
return ( | ||
<div style={{ display: 'flex', flexWrap: 'wrap', justifyContent: 'space-between' }}> | ||
{filtered && filtered.length > 0 ? ( | ||
filtered.map((item, index) => ( | ||
<Card key={index} sx={{ width: '30%', marginBottom: '20px' }}> | ||
{/* Utilisation de la première image du tableau medias */} | ||
<CardMedia sx={{ height: 140 }} image={item.medias[0].value} title="Media" /> | ||
<CardContent> | ||
<Typography gutterBottom variant="h5" component="div"> | ||
Media {item.id} | ||
</Typography> | ||
<Typography variant="body2" color="text.secondary"> | ||
Type: {item.type}, Subtype: {item.subType} | ||
Check failure on line 34 in src/components/admin/mediatheque/CardMediatheque.tsx GitHub Actions / typescript
|
||
</Typography> | ||
<Typography variant="body2" color="text.secondary"> | ||
User ID: {item.userId}, Village ID: {item.villageId} | ||
Check failure on line 37 in src/components/admin/mediatheque/CardMediatheque.tsx GitHub Actions / typescript
|
||
</Typography> | ||
</CardContent> | ||
<CardActions> | ||
<Button size="small">En savoir plus</Button> | ||
</CardActions> | ||
</Card> | ||
)) | ||
) : ( | ||
<p>Aucun média disponible</p> | ||
)} | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters