Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 

419 rindas
16 KiB

  1. import React from "react";
  2. import classNames from "classnames";
  3. import { makeStyles } from "@material-ui/core/styles";
  4. import GridContainer from "components/Grid/GridContainer.js";
  5. import GridItem from "components/Grid/GridItem.js";
  6. import NavPills from "components/NavPills/NavPills.js";
  7. import Card from "components/Card/Card.js";
  8. import CardBody from "components/Card/CardBody.js";
  9. import CardHeader from "components/Card/CardHeader.js";
  10. import Button from "components/CustomButtons/Button.js";
  11. import styles from "assets/jss/nextjs-material-kit/pages/profilePage.js";
  12. import Icon from "@material-ui/core/Icon";
  13. import { Motorcycle } from "@material-ui/icons";
  14. import NumberFormat from 'react-number-format';
  15. const useStyles = makeStyles(styles);
  16. const DataProduct = function ({ backend, maxi, matic, naked, sport, offroad, moped, monsterenergy, cbu, product, ...props }) {
  17. const classes = useStyles();
  18. const { ...rest } = props;
  19. const imageClasses = classNames(
  20. classes.imgRaised,
  21. classes.imgRoundedCircle,
  22. classes.imgFluid
  23. );
  24. const navImageClasses = classNames(classes.imgRounded, classes.imgGallery);
  25. const Product = product.map((data) => {
  26. return (
  27. <div style={{padding: "20px", marginTop:"-40px"}}>
  28. <Card className={classes.textCenter} align="center" style={{width:"300px"}}>
  29. <CardBody>
  30. <div>
  31. <img style={{ width: "200px", display: "block" }} src={`${backend}${data.img[0]["url"]}`} className={navImageClasses}
  32. />
  33. <div align="center">
  34. <h5><b>{data.name}</b></h5>
  35. <Button
  36. color="info" round
  37. href={"/yamaha/product/product_detail?s="+data.id}
  38. >
  39. <Icon className={classes.icons}>open_in_new</Icon>Detail Product
  40. </Button>
  41. {/* <Button
  42. color="info" round
  43. href={"/yamaha/cart/checkout?s="+data.id}
  44. >
  45. <Icon className={classes.icons}>shopping_cart</Icon>Add to Cart
  46. </Button> */}
  47. </div>
  48. </div>
  49. </CardBody>
  50. </Card>
  51. </div>
  52. );
  53. })
  54. const Productmaxi = maxi.map((data) => {
  55. return (
  56. <div style={{padding: "20px", marginTop:"-40px"}}>
  57. <Card className={classes.textCenter} align="center" style={{width:"350px"}}>
  58. <CardBody>
  59. <div style={{padding:"10px"}}>
  60. <img style={{ width: "250px", display: "block" }} src={`${backend}${data.img[0]["url"]}`} className={navImageClasses}
  61. />
  62. <div align="center">
  63. <h5><b>{data.name}</b></h5>
  64. <h5>
  65. <b><NumberFormat value={data.price} displayType={'text'} thousandSeparator={true} prefix={'Rp.'} /></b>
  66. </h5>
  67. <Button
  68. color="info" round
  69. href={"/yamaha/product/product_detail?s="+data.id}
  70. >
  71. <Icon className={classes.icons}>open_in_new</Icon>Detail Product
  72. </Button>
  73. <Button
  74. color="info" round
  75. href={"/yamaha/cart/checkout?s="+data.id}
  76. >
  77. <Icon className={classes.icons}>shopping_cart</Icon>Add to Cart
  78. </Button>
  79. </div>
  80. </div>
  81. </CardBody>
  82. </Card>
  83. </div>
  84. );
  85. })
  86. const Productmatic = matic.map((data) => {
  87. return (
  88. <div style={{padding: "20px", marginTop:"-40px"}}>
  89. <Card className={classes.textCenter} align="center" style={{width:"350px"}}>
  90. <CardBody>
  91. <div style={{padding:"10px"}}>
  92. <img style={{ width: "250px", display: "block" }} src={`${backend}${data.img[0]["url"]}`} className={navImageClasses}
  93. />
  94. <div align="center">
  95. <h5><b>{data.name}</b></h5>
  96. <h5>
  97. <b><NumberFormat value={data.price} displayType={'text'} thousandSeparator={true} prefix={'Rp.'} /></b>
  98. </h5>
  99. <Button
  100. color="info" round
  101. href={"/yamaha/product/product_detail?s="+data.id}
  102. >
  103. <Icon className={classes.icons}>open_in_new</Icon>Detail Product
  104. </Button>
  105. {/* <Button
  106. color="info" round
  107. href={"/yamaha/cart/checkout?s="+data.id}
  108. >
  109. <Icon className={classes.icons}>shopping_cart</Icon>Add to Cart
  110. </Button> */}
  111. </div>
  112. </div>
  113. </CardBody>
  114. </Card>
  115. </div>
  116. );
  117. })
  118. const Productnaked = naked.map((data) => {
  119. return (
  120. <div style={{padding: "20px", marginTop:"-40px"}}>
  121. <Card className={classes.textCenter} align="center" style={{width:"350px"}}>
  122. <CardBody>
  123. <div style={{padding:"10px"}}>
  124. <img style={{ width: "250px", display: "block" }} src={`${backend}${data.img[0]["url"]}`} className={navImageClasses}
  125. />
  126. <div align="center">
  127. <h5><b>{data.name}</b></h5>
  128. <h5>
  129. <b><NumberFormat value={data.price} displayType={'text'} thousandSeparator={true} prefix={'Rp.'} /></b>
  130. </h5>
  131. <Button
  132. color="info" round
  133. href={"/yamaha/product/product_detail?s="+data.id}
  134. >
  135. <Icon className={classes.icons}>open_in_new</Icon>Detail Product
  136. </Button>
  137. {/* <Button
  138. color="info" round
  139. href={"/yamaha/cart/checkout?s="+data.id}
  140. >
  141. <Icon className={classes.icons}>shopping_cart</Icon>Add to Cart
  142. </Button> */}
  143. </div>
  144. </div>
  145. </CardBody>
  146. </Card>
  147. </div>
  148. );
  149. })
  150. const Productsport = sport.map((data) => {
  151. return (
  152. <div style={{padding: "20px", marginTop:"-40px"}}>
  153. <Card className={classes.textCenter} align="center" style={{width:"350px"}}>
  154. <CardBody>
  155. <div style={{padding:"10px"}}>
  156. <img style={{ width: "250px", display: "block" }} src={`${backend}${data.img[0]["url"]}`} className={navImageClasses}
  157. />
  158. <div align="center">
  159. <h5><b>{data.name}</b></h5>
  160. <h5>
  161. <b><NumberFormat value={data.price} displayType={'text'} thousandSeparator={true} prefix={'Rp.'} /></b>
  162. </h5>
  163. <Button
  164. color="info" round
  165. href={"/yamaha/product/product_detail?s="+data.id}
  166. >
  167. <Icon className={classes.icons}>open_in_new</Icon>Detail Product
  168. </Button>
  169. {/* <Button
  170. color="info" round
  171. href={"/yamaha/cart/checkout?s="+data.id}
  172. >
  173. <Icon className={classes.icons}>shopping_cart</Icon>Add to Cart
  174. </Button> */}
  175. </div>
  176. </div>
  177. </CardBody>
  178. </Card>
  179. </div>
  180. );
  181. })
  182. const Productoffroad = offroad.map((data) => {
  183. return (
  184. <div style={{padding: "20px", marginTop:"-40px"}}>
  185. <Card className={classes.textCenter} align="center" style={{width:"350px"}}>
  186. <CardBody>
  187. <div style={{padding:"10px"}}>
  188. <img style={{ width: "250px", display: "block" }} src={`${backend}${data.img[0]["url"]}`} className={navImageClasses}
  189. />
  190. <div align="center">
  191. <h5><b>{data.name}</b></h5>
  192. <h5>
  193. <b><NumberFormat value={data.price} displayType={'text'} thousandSeparator={true} prefix={'Rp.'} /></b>
  194. </h5>
  195. <Button
  196. color="info" round
  197. href={"/yamaha/product/product_detail?s="+data.id}
  198. >
  199. <Icon className={classes.icons}>open_in_new</Icon>Detail Product
  200. </Button>
  201. {/* <Button
  202. color="info" round
  203. href={"/yamaha/cart/checkout?s="+data.id}
  204. >
  205. <Icon className={classes.icons}>shopping_cart</Icon>Add to Cart
  206. </Button> */}
  207. </div>
  208. </div>
  209. </CardBody>
  210. </Card>
  211. </div>
  212. );
  213. })
  214. const Productmoped = moped.map((data) => {
  215. return (
  216. <div style={{padding: "20px", marginTop:"-40px"}}>
  217. <Card className={classes.textCenter} align="center" style={{width:"350px"}}>
  218. <CardBody>
  219. <div style={{padding:"10px"}}>
  220. <img style={{ width: "250px", display: "block" }} src={`${backend}${data.img[0]["url"]}`} className={navImageClasses}
  221. />
  222. <div align="center">
  223. <h5><b>{data.name}</b></h5>
  224. <h5>
  225. <b><NumberFormat value={data.price} displayType={'text'} thousandSeparator={true} prefix={'Rp.'} /></b>
  226. </h5>
  227. <Button
  228. color="info" round
  229. href={"/yamaha/product/product_detail?s="+data.id}
  230. >
  231. <Icon className={classes.icons}>open_in_new</Icon>Detail Product
  232. </Button>
  233. {/* <Button
  234. color="info" round
  235. href={"/yamaha/cart/checkout?s="+data.id}
  236. >
  237. <Icon className={classes.icons}>shopping_cart</Icon>Add to Cart
  238. </Button> */}
  239. </div>
  240. </div>
  241. </CardBody>
  242. </Card>
  243. </div>
  244. );
  245. })
  246. const Productmonsterenergy = monsterenergy.map((data) => {
  247. return (
  248. <div style={{padding: "20px", marginTop:"-40px"}}>
  249. <Card className={classes.textCenter} align="center" style={{width:"350px"}}>
  250. <CardBody>
  251. <div style={{padding:"10px"}}>
  252. <img style={{ width: "250px", display: "block" }} src={`${backend}${data.img[0]["url"]}`} className={navImageClasses}
  253. />
  254. <div align="center">
  255. <h5><b>{data.name}</b></h5>
  256. <h5>
  257. <b><NumberFormat value={data.price} displayType={'text'} thousandSeparator={true} prefix={'Rp.'} /></b>
  258. </h5>
  259. <Button
  260. color="info" round
  261. href={"/yamaha/product/product_detail?s="+data.id}
  262. >
  263. <Icon className={classes.icons}>open_in_new</Icon>Detail Product
  264. </Button>
  265. {/* <Button
  266. color="info" round
  267. href={"/yamaha/cart/checkout?s="+data.id}
  268. >
  269. <Icon className={classes.icons}>shopping_cart</Icon>Add to Cart
  270. </Button> */}
  271. </div>
  272. </div>
  273. </CardBody>
  274. </Card>
  275. </div>
  276. );
  277. })
  278. const Productcbu = cbu.map((data) => {
  279. return (
  280. <div style={{padding: "20px", marginTop:"-40px"}}>
  281. <Card className={classes.textCenter} align="center" style={{width:"350px"}}>
  282. <CardBody>
  283. <div style={{padding:"10px"}}>
  284. <img style={{ width: "250px", display: "block" }} src={`${backend}${data.img[0]["url"]}`} className={navImageClasses}
  285. />
  286. <div align="center">
  287. <h5><b>{data.name}</b></h5>
  288. <h5>
  289. <b><NumberFormat value={data.price} displayType={'text'} thousandSeparator={true} prefix={'Rp.'} /></b>
  290. </h5>
  291. <Button
  292. color="info" round
  293. href={"/yamaha/product/product_detail?s="+data.id}
  294. >
  295. <Icon className={classes.icons}>open_in_new</Icon>Detail Product
  296. </Button>
  297. {/* <Button
  298. color="info" round
  299. href={"/yamaha/cart/checkout?s="+data.id}
  300. >
  301. <Icon className={classes.icons}>shopping_cart</Icon>Add to Cart
  302. </Button> */}
  303. </div>
  304. </div>
  305. </CardBody>
  306. </Card>
  307. </div>
  308. );
  309. })
  310. return (
  311. <Card className={classes.textCenter}>
  312. <div align="center">
  313. <CardHeader color="info">Product</CardHeader>
  314. </div>
  315. <CardBody>
  316. <div align="center">
  317. <h2><b>Product & Facilities</b></h2>
  318. </div>
  319. <GridContainer justify="center">
  320. <GridItem>
  321. <NavPills
  322. alignCenter
  323. color="primary"
  324. tabs={[
  325. {
  326. tabButton: "Motor Product",
  327. tabIcon: Motorcycle,
  328. tabContent: (
  329. <GridContainer justify="center">
  330. {Product}
  331. </GridContainer>
  332. ),
  333. },
  334. //{
  335. // tabButton: "Matic",
  336. // tabIcon: Motorcycle,
  337. // tabContent: (
  338. // <GridContainer justify="center">
  339. // {Productmatic}
  340. // </GridContainer>
  341. // ),
  342. // },
  343. // {
  344. // tabButton: "Naked Bike",
  345. // tabIcon: Motorcycle,
  346. // tabContent: (
  347. // <GridContainer justify="center">
  348. // {Productnaked}
  349. // </GridContainer>
  350. // ),
  351. // },
  352. // {
  353. // tabButton: "Sport",
  354. // tabIcon: Motorcycle,
  355. // tabContent: (
  356. // <GridContainer justify="center">
  357. // {Productsport}
  358. // </GridContainer>
  359. // ),
  360. // },
  361. // {
  362. // tabButton: "Off Road",
  363. // tabIcon: Motorcycle,
  364. // tabContent: (
  365. // <GridContainer justify="center">
  366. // {Productoffroad}
  367. // </GridContainer>
  368. // ),
  369. // },
  370. // {
  371. // tabButton: "Moped",
  372. // tabIcon: Motorcycle,
  373. // tabContent: (
  374. // <GridContainer justify="center">
  375. // {Productmoped}
  376. // </GridContainer>
  377. // ),
  378. // },
  379. // {
  380. // tabButton: "Monster Energy MotoGP",
  381. // tabIcon: Motorcycle,
  382. // tabContent: (
  383. // <GridContainer justify="center">
  384. // {Productmonsterenergy}
  385. // </GridContainer>
  386. // ),
  387. // },
  388. // {
  389. // tabButton: "CBU",
  390. // tabIcon: Motorcycle,
  391. // tabContent: (
  392. // <GridContainer justify="center">
  393. // {Productcbu}
  394. // </GridContainer>
  395. // ),
  396. // },
  397. // {
  398. // tabButton: "ATV",
  399. // tabIcon: Motorcycle,
  400. // tabContent: (
  401. // <GridContainer justify="center">
  402. // {Productcbu}
  403. // </GridContainer>
  404. // ),
  405. // },
  406. ]}
  407. />
  408. </GridItem>
  409. </GridContainer>
  410. </CardBody>
  411. </Card>
  412. );
  413. }
  414. export default DataProduct;