%PDF- %PDF-
Direktori : /proc/thread-self/root/var/www/html/pages/ |
Current File : //proc/thread-self/root/var/www/html/pages/index.js |
import Header from "../src/Components/Header"; import About from "../src/Components/About"; import ChooseTour from "../src/Components/ChooseTour"; import Rent from "../src/Components/Rent"; import News from "../src/Components/News"; import Contact from "../src/Components/Contact"; import CustomHead from "../src/Components/Global/CustomHead"; export default function Home({ data, seo }) { return ( <> <CustomHead data={seo} /> <Header data={data} /> <About data={data} /> <div className="vector-wrapper"> <ChooseTour data={data} /> <Rent data={data} /> </div> <News data={data} /> <Contact /> </> ); } export async function getServerSideProps(ctx) { const res = await fetch( `https://api.atvbuggy-dubrovnik.com/wp-json/api/v1/homepage` ) .then((response) => response.json()) .then((data) => data); const seo = await fetch( `https://api.atvbuggy-dubrovnik.com/wp-json/wp/v2/pages?slug=homepage` ) .then((response) => response.json()) .then((data) => data[0]); if (!res) { return { notFound: true, }; } return { props: { data: res, seo: seo.yoast_head_json, }, }; }