25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

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