You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

56 rivejä
2.1 KiB

  1. import React from 'react';
  2. import Link from 'next/link';
  3. import * as Icon from 'react-feather';
  4. const Dealers = function ({ title,backend, dealers, ...props }) {
  5. const ListDealer = (dealers)?dealers.map((data,idx) => {
  6. try{
  7. if(data.attributes.Gmap && data.attributes.Gmap[0]=='<'){
  8. var span = document.createElement('span');
  9. span.innerHTML = data.attributes.Gmap;
  10. data.attributes.Gmap = span.textContent || span.innerText;
  11. }
  12. }
  13. catch(e){
  14. }
  15. return (
  16. <div key={idx} className="col-lg-4 col-sm-6 col-md-6">
  17. <div className="agency-services-box">
  18. <img style={{ height: "250px", width: "100%", display: "block" }} src={(data.attributes.Image.data)?`/api/util?img=${encodeURIComponent(data.attributes.Image.data.attributes.url)}`:"/images/blog-image/blog-details.jpg"} alt="image" />
  19. <div className="content">
  20. <p>
  21. <p><b>{data.attributes.Name} - {data.attributes.Kota}</b></p>
  22. <p><b>{data.attributes.Telp}</b></p>
  23. <p><b>{data.attributes.Address}</b></p>
  24. </p>
  25. <Link href={`${data.attributes.Gmap}`} target="_blank">
  26. <a className="read-more-btn" target="_blank">
  27. View Location <Icon.MapPin />
  28. </a>
  29. </Link>
  30. </div>
  31. </div>
  32. </div>
  33. );
  34. }):"";
  35. return (
  36. <div>
  37. <div className="agency-services-area pt-50 pb-50">
  38. <div className="container">
  39. <div className="section-title st-fs-28">
  40. <h2>{title}</h2>
  41. </div>
  42. <div className="row justify-content">
  43. {ListDealer||<div className="bar"></div>}
  44. </div>
  45. </div>
  46. </div>
  47. </div>
  48. );
  49. }
  50. export default Dealers;