MyPosts.js 1.1 KB

123456789101112131415161718192021222324252627282930
  1. import React from "react";
  2. import {Link} from 'react-router-dom';
  3. import { Container } from "react-bootstrap";
  4. import nofoto from '../images/placeholder.png'
  5. export const MyFeed=({_id, price, owner,title,description,images,comments,createdAt}) => {
  6. return (
  7. <Container>
  8. <div className="row ad">
  9. <div className="col img">
  10. {images ?
  11. <img src = {`http://marketplace.asmer.fs.a-level.com.ua/${images[0]?.url}`} />
  12. : <img src={nofoto} />
  13. }
  14. </div>
  15. <div className="col-6">
  16. <Link to={ `/home/${_id}`}>{title}</Link>
  17. <p>{description}</p>
  18. </div>
  19. <div className="col price">
  20. <p>{`${price ? price : "0"} грн.`}</p>
  21. </div>
  22. <div>
  23. <Link className='href' to={`/home/edit/${_id}`}>Редактировать</Link>
  24. </div>
  25. </div>
  26. </Container>
  27. )
  28. }