Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

612 строки
27 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. import SnackbarContent from "components/Snackbar/SnackbarContent.js";
  16. const useStyles = makeStyles(styles);
  17. const DataProduct = function ({
  18. backend,
  19. ygp,
  20. yamalube,
  21. rconcept,
  22. mtx,
  23. extreme,
  24. ranger,
  25. fighter,
  26. swirl,
  27. classic,
  28. uno,
  29. apparel,
  30. asia,
  31. basic,
  32. merchand,
  33. maxi,
  34. rainsuit,
  35. motogp,
  36. offroad,
  37. accessories, ...props }) {
  38. console.log(rconcept);
  39. const classes = useStyles();
  40. const { ...rest } = props;
  41. const imageClasses = classNames(
  42. classes.imgRaised,
  43. classes.imgRoundedCircle,
  44. classes.imgFluid
  45. );
  46. const navImageClasses = classNames(classes.imgRounded, classes.imgGallery);
  47. const YGP = ygp.map((data) => {
  48. return (
  49. <div style={{padding: "20px", marginTop:"-40px"}}>
  50. <Card className={classes.textCenter} align="center" style={{width:"300px"}}>
  51. <CardBody>
  52. <div align="center" style={{padding:"10px"}}>
  53. <img style={{ width: "150px", display: "block" }} src={`${backend}${data.img["url"]}`} className={navImageClasses}
  54. />
  55. <div align="center">
  56. <h5>{data.name}</h5>
  57. <h5>
  58. <NumberFormat value={data.price} displayType={'text'} thousandSeparator={true} prefix={'Rp.'} />
  59. </h5><br/>
  60. <Button
  61. color="info" round
  62. href={"/yamaha/product/ygp_detail?s="+data.id}
  63. >
  64. <Icon className={classes.icons}>open_in_new</Icon>Detail Product
  65. </Button>
  66. </div>
  67. </div>
  68. </CardBody>
  69. </Card>
  70. </div>
  71. );
  72. })
  73. const Yamalube = yamalube.map((data) => {
  74. return (
  75. <div style={{padding: "20px", marginTop:"-40px"}}>
  76. <Card className={classes.textCenter} align="center" style={{width:"300px", height:"350px"}}>
  77. <CardBody>
  78. <div align="center" style={{padding:"10px"}}>
  79. <img style={{ width: "100px", height:"100px", display: "block" }} src={`${backend}${data.img["url"]}`} className={navImageClasses}
  80. />
  81. <div align="center">
  82. <h5>{data.name}</h5>
  83. <h5>
  84. <NumberFormat value={data.price} displayType={'text'} thousandSeparator={true} prefix={'Rp.'} />
  85. </h5><br/>
  86. <Button
  87. color="info" round
  88. href={"/yamaha/product/yamalube_detail?s="+data.id}
  89. >
  90. <Icon className={classes.icons}>open_in_new</Icon>Detail Product
  91. </Button>
  92. </div>
  93. </div>
  94. </CardBody>
  95. </Card>
  96. </div>
  97. );
  98. })
  99. const HelmetRConcepts = rconcept.map((data) => {
  100. return (
  101. <div style={{padding: "20px", marginTop:"-40px"}}>
  102. <Card className={classes.textCenter} align="center" style={{width:"300px"}}>
  103. <CardBody>
  104. <div align="center" style={{padding:"10px"}}>
  105. <img style={{ width: "150px", display: "block" }} src={`${backend}${data.img["url"]}`} className={navImageClasses}
  106. />
  107. <div align="center">
  108. <h5>{data.name}</h5>
  109. <h5>
  110. <NumberFormat value={data.price} displayType={'text'} thousandSeparator={true} prefix={'Rp.'} />
  111. </h5>
  112. <Button
  113. color="info" round
  114. href={"/yamaha/product/helmet_details?s="+data.id}
  115. >
  116. <Icon className={classes.icons}>open_in_new</Icon>Detail Product
  117. </Button>
  118. </div>
  119. </div>
  120. </CardBody>
  121. </Card>
  122. </div>
  123. );
  124. })
  125. const HelmetMTX = mtx.map((data) => {
  126. return (
  127. <div style={{padding: "20px", marginTop:"-40px"}}>
  128. <Card className={classes.textCenter} align="center" style={{width:"300px"}}>
  129. <CardBody>
  130. <div align="center" style={{padding:"10px"}}>
  131. <img style={{ width: "100px", display: "block" }} src={`${backend}${data.img["url"]}`} className={navImageClasses}
  132. />
  133. <div align="center">
  134. <h5>{data.name}</h5>
  135. <h5>
  136. <NumberFormat value={data.price} displayType={'text'} thousandSeparator={true} prefix={'Rp.'} />
  137. </h5>
  138. <Button
  139. color="info" round
  140. href={"/yamaha/product/helmet_details?s="+data.id}
  141. >
  142. <Icon className={classes.icons}>open_in_new</Icon>Detail Product
  143. </Button>
  144. </div>
  145. </div>
  146. </CardBody>
  147. </Card>
  148. </div>
  149. );
  150. })
  151. const HelmetExtreme = extreme.map((data) => {
  152. return (
  153. <div style={{padding: "20px", marginTop:"-40px"}}>
  154. <Card className={classes.textCenter} align="center" style={{width:"300px"}}>
  155. <CardBody>
  156. <div align="center" style={{padding:"10px"}}>
  157. <img style={{ width: "100px", display: "block" }} src={`${backend}${data.img["url"]}`} className={navImageClasses}
  158. />
  159. <div align="center">
  160. <h5>{data.name}</h5>
  161. <h5>
  162. <NumberFormat value={data.price} displayType={'text'} thousandSeparator={true} prefix={'Rp.'} />
  163. </h5>
  164. <Button
  165. color="info" round
  166. href={"/yamaha/product/helmet_details?s="+data.id}
  167. >
  168. <Icon className={classes.icons}>open_in_new</Icon>Detail Product
  169. </Button>
  170. </div>
  171. </div>
  172. </CardBody>
  173. </Card>
  174. </div>
  175. );
  176. })
  177. const HelmetRanger = ranger.map((data) => {
  178. return (
  179. <div style={{padding: "20px", marginTop:"-40px"}}>
  180. <Card className={classes.textCenter} align="center" style={{width:"300px"}}>
  181. <CardBody>
  182. <div align="center" style={{padding:"10px"}}>
  183. <img style={{ width: "100px", display: "block" }} src={`${backend}${data.img["url"]}`} className={navImageClasses}
  184. />
  185. <div align="center">
  186. <h5>{data.name}</h5>
  187. <h5>
  188. <NumberFormat value={data.price} displayType={'text'} thousandSeparator={true} prefix={'Rp.'} />
  189. </h5>
  190. <Button
  191. color="info" round
  192. href={"/yamaha/product/helmet_details?s="+data.id}
  193. >
  194. <Icon className={classes.icons}>open_in_new</Icon>Detail Product
  195. </Button>
  196. </div>
  197. </div>
  198. </CardBody>
  199. </Card>
  200. </div>
  201. );
  202. })
  203. const HelmetFighter = fighter.map((data) => {
  204. return (
  205. <div style={{padding: "20px", marginTop:"-40px"}}>
  206. <Card className={classes.textCenter} align="center" style={{width:"300px"}}>
  207. <CardBody>
  208. <div align="center" style={{padding:"10px"}}>
  209. <img style={{ width: "100px", display: "block" }} src={`${backend}${data.img["url"]}`} className={navImageClasses}
  210. />
  211. <div align="center">
  212. <h5>{data.name}</h5>
  213. <h5>
  214. <NumberFormat value={data.price} displayType={'text'} thousandSeparator={true} prefix={'Rp.'} />
  215. </h5>
  216. <Button
  217. color="info" round
  218. href={"/yamaha/product/helmet_details?s="+data.id}
  219. >
  220. <Icon className={classes.icons}>open_in_new</Icon>Detail Product
  221. </Button>
  222. </div>
  223. </div>
  224. </CardBody>
  225. </Card>
  226. </div>
  227. );
  228. })
  229. const HelmetSwirl = swirl.map((data) => {
  230. return (
  231. <div style={{padding: "20px", marginTop:"-40px"}}>
  232. <Card className={classes.textCenter} align="center" style={{width:"300px"}}>
  233. <CardBody>
  234. <div align="center" style={{padding:"10px"}}>
  235. <img style={{ width: "100px", display: "block" }} src={`${backend}${data.img["url"]}`} className={navImageClasses}
  236. />
  237. <div align="center">
  238. <h5>{data.name}</h5>
  239. <h5>
  240. <NumberFormat value={data.price} displayType={'text'} thousandSeparator={true} prefix={'Rp.'} />
  241. </h5>
  242. <Button
  243. color="info" round
  244. href={"/yamaha/product/helmet_details?s="+data.id}
  245. >
  246. <Icon className={classes.icons}>open_in_new</Icon>Detail Product
  247. </Button>
  248. </div>
  249. </div>
  250. </CardBody>
  251. </Card>
  252. </div>
  253. );
  254. })
  255. const HelmetClassic = classic.map((data) => {
  256. return (
  257. <div style={{padding: "20px", marginTop:"-40px"}}>
  258. <Card className={classes.textCenter} align="center" style={{width:"300px"}}>
  259. <CardBody>
  260. <div align="center" style={{padding:"10px"}}>
  261. <img style={{ width: "100px", display: "block" }} src={`${backend}${data.img["url"]}`} className={navImageClasses}
  262. />
  263. <div align="center">
  264. <h5>{data.name}</h5>
  265. <h5>
  266. <NumberFormat value={data.price} displayType={'text'} thousandSeparator={true} prefix={'Rp.'} />
  267. </h5>
  268. <Button
  269. color="info" round
  270. href={"/yamaha/product/helmet_details?s="+data.id}
  271. >
  272. <Icon className={classes.icons}>open_in_new</Icon>Detail Product
  273. </Button>
  274. </div>
  275. </div>
  276. </CardBody>
  277. </Card>
  278. </div>
  279. );
  280. })
  281. const HelmetUno = uno.map((data) => {
  282. return (
  283. <div style={{padding: "20px", marginTop:"-40px"}}>
  284. <Card className={classes.textCenter} align="center" style={{width:"300px"}}>
  285. <CardBody>
  286. <div align="center" style={{padding:"10px"}}>
  287. <img style={{ width: "100px", display: "block" }} src={`${backend}${data.img["url"]}`} className={navImageClasses}
  288. />
  289. <div align="center">
  290. <h5>{data.name}</h5>
  291. <h5>
  292. <NumberFormat value={data.price} displayType={'text'} thousandSeparator={true} prefix={'Rp.'} />
  293. </h5>
  294. <Button
  295. color="info" round
  296. href={"/yamaha/product/helmet_details?s="+data.id}
  297. >
  298. <Icon className={classes.icons}>open_in_new</Icon>Detail Product
  299. </Button>
  300. </div>
  301. </div>
  302. </CardBody>
  303. </Card>
  304. </div>
  305. );
  306. })
  307. const ApparelRConcept = apparel.map((data) => {
  308. return (
  309. <div style={{padding: "20px", marginTop:"-40px"}}>
  310. <Card className={classes.textCenter} align="center" style={{width:"300px"}}>
  311. <CardBody>
  312. <div align="center" style={{padding:"10px"}}>
  313. <img style={{ width: "100px", display: "block" }} src={`${backend}${data.img["url"]}`} className={navImageClasses}
  314. />
  315. <div align="center">
  316. <h5>{data.name}</h5>
  317. <h5>
  318. <NumberFormat value={data.price} displayType={'text'} thousandSeparator={true} prefix={'Rp.'} />
  319. </h5>
  320. <Button
  321. color="info" round
  322. href={"/yamaha/product/helmet_details?s="+data.id}
  323. >
  324. <Icon className={classes.icons}>open_in_new</Icon>Detail Product
  325. </Button>
  326. </div>
  327. </div>
  328. </CardBody>
  329. </Card>
  330. </div>
  331. );
  332. })
  333. const ApparelAsia = asia.map((data) => {
  334. return (
  335. <div style={{padding: "20px", marginTop:"-40px"}}>
  336. <Card className={classes.textCenter} align="center" style={{width:"350px"}}>
  337. <CardBody>
  338. <div style={{padding:"10px"}}>
  339. <img
  340. alt="..."
  341. style={{ height: "150px", display: "block" }}
  342. src={`${backend}${data.img["url"]}`}
  343. className={navImageClasses}
  344. />
  345. <div align="center">
  346. <h5>{data.name}</h5>
  347. <h5>
  348. <NumberFormat value={data.price} displayType={'text'} thousandSeparator={true} prefix={'Rp.'}/>
  349. </h5>
  350. <Button
  351. color="info" round
  352. href={"/yamaha/product/apparel_details?s="+data.id}
  353. >
  354. <Icon className={classes.icons}>open_in_new</Icon>Detail Product
  355. </Button>
  356. </div>
  357. </div>
  358. </CardBody>
  359. </Card>
  360. </div>
  361. );
  362. })
  363. const Accessories = accessories.map((data) => {
  364. return (
  365. <div style={{padding: "20px", marginTop:"-40px"}}>
  366. <Card className={classes.textCenter} align="center" style={{width:"300px"}}>
  367. <CardBody>
  368. <div align="center" style={{padding:"10px"}}>
  369. <img style={{ width: "100px", display: "block" }} src={`${backend}${data.img["url"]}`} className={navImageClasses}
  370. />
  371. <div align="center">
  372. <h5>{data.name}</h5>
  373. <h5>
  374. <NumberFormat value={data.price} displayType={'text'} thousandSeparator={true} prefix={'Rp.'} />
  375. </h5>
  376. <Button
  377. color="info" round
  378. href={"/yamaha/product/helmet_details?s="+data.id}
  379. >
  380. <Icon className={classes.icons}>open_in_new</Icon>Detail Product
  381. </Button>
  382. </div>
  383. </div>
  384. </CardBody>
  385. </Card>
  386. </div>
  387. );
  388. })
  389. return (
  390. <Card className={classes.textCenter}>
  391. <div align="center">
  392. <CardHeader color="info">Product</CardHeader>
  393. </div>
  394. <CardBody>
  395. <div align="center">
  396. <h2>Sparepart & Accessories</h2>
  397. </div>
  398. <GridContainer justify="center">
  399. <GridItem>
  400. <NavPills
  401. alignCenter
  402. color="primary"
  403. tabs={[
  404. {
  405. tabButton: "YGP",
  406. tabIcon: Motorcycle,
  407. tabContent: (
  408. <GridContainer justify="center">
  409. {YGP}
  410. </GridContainer>
  411. ),
  412. },
  413. {
  414. tabButton: "Yamalube",
  415. tabIcon: Motorcycle,
  416. tabContent: (
  417. <GridContainer justify="center">
  418. {Yamalube}
  419. </GridContainer>
  420. ),
  421. },
  422. {
  423. tabButton: "Helmet",
  424. tabIcon: Motorcycle,
  425. tabContent: (
  426. <div>
  427. <div align="center">
  428. <div align="center" className={classes.section} id="notifications">
  429. <SnackbarContent
  430. message={
  431. <h4>R CONCEPT</h4>
  432. }
  433. align="center"
  434. color="info"
  435. />
  436. </div>
  437. <GridContainer justify="center" style={{padding:"40px", marginTop:"-50px"}}>
  438. {HelmetRConcepts}
  439. </GridContainer>
  440. </div><br></br><br></br>
  441. <div align="center" style={{marginTop:"-50px"}}>
  442. <div align="center" className={classes.section} id="notifications">
  443. <SnackbarContent
  444. message={
  445. <h4>MTX</h4>
  446. }
  447. align="center"
  448. color="info"
  449. />
  450. </div>
  451. <GridContainer justify="center" style={{padding:"40px", marginTop:"-50px"}}>
  452. {HelmetMTX}
  453. </GridContainer>
  454. </div><br></br><br></br>
  455. <div align="center" style={{marginTop:"-50px"}}>
  456. <div align="center" className={classes.section} id="notifications">
  457. <SnackbarContent
  458. message={
  459. <h4>Extreme</h4>
  460. }
  461. align="center"
  462. color="info"
  463. />
  464. </div>
  465. <GridContainer justify="center" style={{padding:"40px", marginTop:"-50px"}}>
  466. {HelmetExtreme}
  467. </GridContainer>
  468. </div><br></br><br></br>
  469. <div align="center" style={{marginTop:"-50px"}}>
  470. <div align="center" className={classes.section} id="notifications">
  471. <SnackbarContent
  472. message={
  473. <h4>Ranger</h4>
  474. }
  475. align="center"
  476. color="info"
  477. />
  478. </div>
  479. <GridContainer justify="center" style={{padding:"40px", marginTop:"-50px"}}>
  480. {HelmetRanger}
  481. </GridContainer>
  482. </div><br></br><br></br>
  483. <div align="center" style={{marginTop:"-50px"}}>
  484. <div align="center" className={classes.section} id="notifications">
  485. <SnackbarContent
  486. message={
  487. <h4>Fighter</h4>
  488. }
  489. align="center"
  490. color="info"
  491. />
  492. </div>
  493. <GridContainer justify="center" style={{padding:"40px", marginTop:"-50px"}}>
  494. {HelmetFighter}
  495. </GridContainer>
  496. </div><br></br><br></br>
  497. <div align="center" style={{marginTop:"-50px"}}>
  498. <div align="center" className={classes.section} id="notifications">
  499. <SnackbarContent
  500. message={
  501. <h4>Swirl</h4>
  502. }
  503. align="center"
  504. color="info"
  505. />
  506. </div>
  507. <GridContainer justify="center" style={{padding:"40px", marginTop:"-50px"}}>
  508. {HelmetSwirl}
  509. </GridContainer>
  510. </div><br></br><br></br>
  511. <div align="center" style={{marginTop:"-50px"}}>
  512. <div align="center" className={classes.section} id="notifications">
  513. <SnackbarContent
  514. message={
  515. <h4>Classic</h4>
  516. }
  517. align="center"
  518. color="info"
  519. />
  520. </div>
  521. <GridContainer justify="center" style={{padding:"40px", marginTop:"-50px"}}>
  522. {HelmetClassic}
  523. </GridContainer>
  524. </div><br></br><br></br>
  525. <div align="center" style={{marginTop:"-50px"}}>
  526. <div align="center" className={classes.section} id="notifications">
  527. <SnackbarContent
  528. message={
  529. <h4>Uno</h4>
  530. }
  531. align="center"
  532. color="info"
  533. />
  534. </div>
  535. <GridContainer justify="center" style={{padding:"40px", marginTop:"-50px"}}>
  536. {HelmetUno}
  537. </GridContainer>
  538. </div><br></br><br></br>
  539. </div>
  540. ),
  541. },
  542. {
  543. tabButton: "Apparel",
  544. tabIcon: Motorcycle,
  545. tabContent: (
  546. <div>
  547. <div align="center">
  548. <div align="center" className={classes.section} id="notifications">
  549. <SnackbarContent
  550. message={
  551. <h4>R Concept Apprael</h4>
  552. }
  553. align="center"
  554. color="info"
  555. />
  556. </div>
  557. <GridContainer justify="center" style={{padding:"40px", marginTop:"-50px"}}>
  558. {ApparelRConcept}
  559. </GridContainer>
  560. </div><br></br><br></br>
  561. <div align="center">
  562. <div align="center" className={classes.section} id="notifications">
  563. <SnackbarContent
  564. message={
  565. <h4>46 Asia</h4>
  566. }
  567. align="center"
  568. color="info"
  569. />
  570. </div>
  571. <GridContainer justify="center" style={{padding:"40px", marginTop:"-50px"}}>
  572. {ApparelAsia}
  573. </GridContainer>
  574. </div><br></br><br></br>
  575. </div>
  576. ),
  577. },
  578. {
  579. tabButton: "Accessories",
  580. tabIcon: Motorcycle,
  581. tabContent: (
  582. <GridContainer justify="center">
  583. {Accessories}
  584. </GridContainer>
  585. ),
  586. },
  587. ]}
  588. />
  589. </GridItem>
  590. </GridContainer>
  591. </CardBody>
  592. </Card>
  593. );
  594. }
  595. export default DataProduct;