-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.tsx
34 lines (31 loc) · 881 Bytes
/
index.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import Clients from '@/components/clients';
import Portfolio from '@/components/portfolio';
import Promo from '@/components/promo';
import Services from '@/components/services';
import { fetchData } from '@/utils/api/config';
import { getStaticPropsTranslations } from '@/utils/helpers/i18n';
import { GetServerSideProps, InferGetServerSidePropsType } from 'next';
export const getServerSideProps: GetServerSideProps = async (context) => {
const posts = await fetchData({
path: "posts/featured",
locale: context.locale,
});
return {
props: {
posts,
...(await getStaticPropsTranslations(context.locale ?? 'ru')),
},
};
};
export default function Home({
posts,
}: InferGetServerSidePropsType<typeof getServerSideProps>) {
return (
<>
<Promo />
<Services />
<Portfolio posts={posts} />
<Clients />
</>
);
}