Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

305 rader
17 KiB

  1. import React from 'react';
  2. import PageBanner from '@/components/Common/PageBanner';
  3. import BlogSidebar from '@/components/Blog/BlogSidebar';
  4. import * as Icon from 'react-feather';
  5. import Link from 'next/link';
  6. import ReactHtmlParser from "react-html-parser";
  7. const News = function ({ backend, news, othernews, ...props }) {
  8. const NewsList = news.map((data) => {
  9. return (
  10. <>
  11. <div className="blog-details-desc">
  12. <div className="article-image">
  13. <img src={`${backend}${data.img[0]["url"]}`} width="800px" alt="image" />
  14. </div>
  15. <div className="article-content">
  16. <div className="entry-meta">
  17. <ul>
  18. <li>
  19. <Icon.Clock /> September 31, 2021
  20. </li>
  21. <li>
  22. <Icon.User /> <a href="#">Steven Smith</a>
  23. </li>
  24. </ul>
  25. </div>
  26. <h2>{data.title}</h2>
  27. <p>{ReactHtmlParser(data.description)}</p>
  28. {/* <blockquote>
  29. <p>It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout.</p>
  30. <cite>Tom Cruise</cite>
  31. </blockquote> */}
  32. <div className="article-footer">
  33. <div className="article-tags">
  34. <a href="#">Motor</a>
  35. <a href="#">Services</a>
  36. <a href="#">Sparepart</a>
  37. <a href="#">Event</a>
  38. <a href="#">Promo</a>
  39. </div>
  40. </div>
  41. </div>
  42. </div>
  43. </>
  44. )
  45. })
  46. const PopularNews = othernews.map((data) => {
  47. return (
  48. <article className="item">
  49. <Link href="/blog-details">
  50. <a className="thumb">
  51. <span className="fullimage cover bg1" role="img"></span>
  52. </a>
  53. </Link>
  54. <div className="info">
  55. <img src={`${backend}${data.img[0]["url"]}`} style={{ width: "100px" }} />
  56. <time>{data.published_at}</time>
  57. <h4 className="title usmall">
  58. <Link href="/blog-details">
  59. <a style={{ fontSize: "15px" }}>{data.title}</a>
  60. </Link>
  61. </h4>
  62. </div>
  63. <div className="clear"></div>
  64. </article>
  65. )
  66. })
  67. return (
  68. <div>
  69. <PageBanner pageTitle="Latest News" />
  70. <div className="blog-details-area ptb-80">
  71. <div className="container">
  72. <div className="row">
  73. <div className="col-lg-8 col-md-12">
  74. {NewsList}
  75. <div className="comments-area">
  76. <h3 className="comments-title">2 Comments:</h3>
  77. <ol className="comment-list">
  78. <li className="comment">
  79. <article className="comment-body">
  80. <footer className="comment-meta">
  81. <div className="comment-author vcard">
  82. <img src="/images/client-image/client1.jpg" className="avatar" alt="image" />
  83. <b className="fn">John Jones</b>
  84. <span className="says">says:</span>
  85. </div>
  86. <div className="comment-metadata">
  87. April 24, 2019 at 10:59 am
  88. </div>
  89. </footer>
  90. <div className="comment-content">
  91. <p>Lorem Ipsum has been the industry’s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen.</p>
  92. </div>
  93. <div className="reply">
  94. <a href="#" className="comment-reply-link">Reply</a>
  95. </div>
  96. </article>
  97. <ol className="children">
  98. <li className="comment">
  99. <article className="comment-body">
  100. <footer className="comment-meta">
  101. <div className="comment-author vcard">
  102. <img src="/images/client-image/client2.jpg" className="avatar" alt="image" />
  103. <b className="fn">Steven Smith</b>
  104. <span className="says">says:</span>
  105. </div>
  106. <div className="comment-metadata">
  107. April 24, 2019 at 10:59 am
  108. </div>
  109. </footer>
  110. <div className="comment-content">
  111. <p>Lorem Ipsum has been the industry’s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen.</p>
  112. </div>
  113. <div className="reply">
  114. <a href="#" className="comment-reply-link">Reply</a>
  115. </div>
  116. </article>
  117. </li>
  118. <ol className="children">
  119. <li className="comment">
  120. <article className="comment-body">
  121. <footer className="comment-meta">
  122. <div className="comment-author vcard">
  123. <img src="/images/client-image/client3.jpg" className="avatar" alt="image" />
  124. <b className="fn">Sarah Taylor</b>
  125. <span className="says">says:</span>
  126. </div>
  127. <div className="comment-metadata">
  128. April 24, 2019 at 10:59 am
  129. </div>
  130. </footer>
  131. <div className="comment-content">
  132. <p>Lorem Ipsum has been the industry’s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen.</p>
  133. </div>
  134. <div className="reply">
  135. <a href="#" className="comment-reply-link">Reply</a>
  136. </div>
  137. </article>
  138. </li>
  139. </ol>
  140. </ol>
  141. </li>
  142. <li className="comment">
  143. <article className="comment-body">
  144. <footer className="comment-meta">
  145. <div className="comment-author vcard">
  146. <img src="/images/client-image/client4.jpg" className="avatar" alt="image" />
  147. <b className="fn">John Doe</b>
  148. <span className="says">says:</span>
  149. </div>
  150. <div className="comment-metadata">
  151. April 24, 2019 at 10:59 am
  152. </div>
  153. </footer>
  154. <div className="comment-content">
  155. <p>Lorem Ipsum has been the industry’s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen.</p>
  156. </div>
  157. <div className="reply">
  158. <a href="#" className="comment-reply-link">Reply</a>
  159. </div>
  160. </article>
  161. <ol className="children">
  162. <li className="comment">
  163. <article className="comment-body">
  164. <footer className="comment-meta">
  165. <div className="comment-author vcard">
  166. <img src="/images/client-image/client5.jpg" className="avatar" alt="image" />
  167. <b className="fn">James Anderson</b>
  168. <span className="says">says:</span>
  169. </div>
  170. <div className="comment-metadata">
  171. April 24, 2019 at 10:59 am
  172. </div>
  173. </footer>
  174. <div className="comment-content">
  175. <p>Lorem Ipsum has been the industry’s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen.</p>
  176. </div>
  177. <div className="reply">
  178. <a href="#" className="comment-reply-link">Reply</a>
  179. </div>
  180. </article>
  181. </li>
  182. </ol>
  183. </li>
  184. </ol>
  185. <div className="comment-respond">
  186. <h3 className="comment-reply-title">Leave a Reply</h3>
  187. <form className="comment-form">
  188. <p className="comment-notes">
  189. <span id="email-notes">Your email address will not be published.</span>
  190. Required fields are marked
  191. <span className="required">*</span>
  192. </p>
  193. <p className="comment-form-comment">
  194. <label>Comment</label>
  195. <textarea name="comment" id="comment" cols="45" rows="5" maxLength="65525" required="required"></textarea>
  196. </p>
  197. <p className="comment-form-author">
  198. <label>Name <span className="required">*</span></label>
  199. <input type="text" id="author" name="author" required="required" />
  200. </p>
  201. <p className="comment-form-email">
  202. <label>Email <span className="required">*</span></label>
  203. <input type="email" id="email" name="email" required="required" />
  204. </p>
  205. <p className="comment-form-url">
  206. <label>Website</label>
  207. <input type="url" id="url" name="url" />
  208. </p>
  209. <p className="comment-form-cookies-consent">
  210. <input type="checkbox" value="yes" name="comment-cookies-consent" id="comment-cookies-consent" />
  211. <label htmlFor="comment-cookies-consent">Save my name, email, and website in this browser for the next time I comment.</label>
  212. </p>
  213. <p className="form-submit">
  214. <input type="submit" name="submit" id="submit" className="submit" value="Post Comment" />
  215. </p>
  216. </form>
  217. </div>
  218. </div>
  219. </div>
  220. <div className="col-lg-4 col-md-12">
  221. <div className="widget-area" id="secondary">
  222. <div className="widget widget_search">
  223. <form className="search-form">
  224. <label>
  225. <input type="search" className="search-field" placeholder="Search..." />
  226. </label>
  227. <button type="submit">
  228. <Icon.Search />
  229. </button>
  230. </form>
  231. </div>
  232. {PopularNews}
  233. <div className="widget widget_categories">
  234. <h3 className="widget-title">Categories</h3>
  235. <ul>
  236. <li><a href="#">Business</a></li>
  237. <li><a href="#">Privacy</a></li>
  238. <li><a href="#">Technology</a></li>
  239. <li><a href="#">Tips</a></li>
  240. <li><a href="#">Uncategorized</a></li>
  241. </ul>
  242. </div>
  243. <div className="widget widget_tag_cloud">
  244. <h3 className="widget-title">Tags</h3>
  245. <div className="tagcloud">
  246. <a href="#">Motor <span className="tag-link-count">(3)</span></a>
  247. <a href="#">Services <span className="tag-link-count">(3)</span></a>
  248. <a href="#">Sparepart <span className="tag-link-count">(2)</span></a>
  249. <a href="#">Promo <span className="tag-link-count">(2)</span></a>
  250. <a href="#">Event <span className="tag-link-count">(1)</span></a>
  251. </div>
  252. </div>
  253. </div>
  254. </div>
  255. </div>
  256. </div>
  257. </div>
  258. </div>
  259. )
  260. }
  261. export default News;