選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

326 行
12 KiB

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