GridGallery.jsx 1.4 KB

12345678910111213141516171819202122232425262728
  1. import { Button, DialogTitle, DialogContent, TextField, DialogActions, Container, Grid, Card, CardMedia, CardContent, Typography, CardActions } from '@mui/material';
  2. // import { makeStyles } from '@mui/material/core/styles';
  3. const GridGallery = ({ cards, backendURL }) => {
  4. return <div className='mainContent'>
  5. <Container className="cardGrid" maxWidth="md">
  6. <Grid container spacing={4}>
  7. {cards.map((card) => (
  8. <Grid item key={card._id} xs={12} sm={6} md={4 }>
  9. <Card className='card'>
  10. {card.images && card.images[0] && card.images[0].url ? <CardMedia className="cardMedia"
  11. image={`${backendURL}/${card.images[0].url}`} title="Image title"></CardMedia> : <CardMedia className="cardMedia">заглушка</CardMedia>}
  12. <CardContent className="cardContent">
  13. <Typography variant="h5" gutterBottom>{card.title }</Typography>
  14. <Typography >{card._id }</Typography>
  15. </CardContent>
  16. <CardActions>
  17. <Button size="small"></Button>
  18. </CardActions>
  19. {/* <LayerIcon/> */}
  20. </Card>
  21. </Grid>))}
  22. </Grid>
  23. </Container>
  24. </div>
  25. }
  26. export default GridGallery;