import { GetServerSideProps } from 'next' import Head from 'next/head' import Image from 'next/image' import { parseCookies } from 'nookies' import React from 'react' import Banner from '../../components/banner/Banner' import Header from '../../components/header/Header' import PageTitle from '../../components/pageTitle/PageTitle' import getAPIClient from '../../services/ssrApi' import { AboutUsView } from '../../styles/layouts/aboutUs/AboutUsView' export default function aboutUs({userName, text}) { return ( Smart Energia - Sobre nós
{/* */}
) } export const getServerSideProps: GetServerSideProps = async (ctx) => { const apiClient = getAPIClient(ctx) const { ['@smartAuth-token']: token } = parseCookies(ctx) const { ['user-name']: userName } = parseCookies(ctx) let text = [] await apiClient.get('/aboutUs').then(res => { text = res.data.data }).catch(res => { // console.log(res) }) if (!token) { return { redirect: { destination: '/', permanent: false } } } return { props: { userName, text } } }