Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.

306 righe
9.3 KiB

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