import React from "react"; import classNames from "classnames"; import { makeStyles } from "@material-ui/core/styles"; import Header from "components/Header/Header.js"; import HeaderLinks from "components/Header/HeaderLinks.js"; import Footer from "components/Footer/Footer.js"; import Parallax from "components/Parallax/Parallax.js"; import styles from "assets/jss/nextjs-material-kit/pages/components.js"; import SectionCarrer from "pages-sections/yamaha/carrer/carrer.js"; import Getcarrer from "../../../api/carrer/carrer.js" const useStyles = makeStyles(styles); const Carrer = function ({ backend, s1, d3, sma, ...props }) { const classes = useStyles(); const { ...rest } = props; return (
} fixed color="info" changeColorOnScroll={{ height: 400, color: "white" }} {...rest} />
); } export default Carrer; export async function getServerSideProps(context) { var s1 = []; var d3 = []; var sma = []; const backend = process.env.BACKEND_SERVER_URI; var res = await Getcarrer.GetCarrerS1Yamaha(); if (res["STATUS"] === 1) { s1 = res["DATA"]["carrers"]; } var res = await Getcarrer.GetCarrerD3Yamaha(); if (res["STATUS"] === 1) { d3 = res["DATA"]["carrers"]; } var res = await Getcarrer.GetCarrerSMAYamaha(); if (res["STATUS"] === 1) { sma = res["DATA"]["carrers"]; } return { props: { s1, d3, sma, backend }, // will be passed to the page component as props }; }