import PostPage from "components/PostPage"; import { getReadySdk } from "graphql/sdk"; import { GetStaticPropsContext } from "next"; import { AppStaticProps, getAppStaticProps } from "graphql/getAppStaticProps"; import { Post } from "helpers/types"; interface Props extends AppStaticProps { post: Post; } export default function Home(props: Props): JSX.Element { const { post, langui, languages, currencies } = props; return (

Accord’s Library

Discover • Analyze • Translate • Archive

} displayTitle={false} displayLanguageSwitcher /> ); } export async function getStaticProps( context: GetStaticPropsContext ): Promise<{ notFound: boolean } | { props: Props }> { const sdk = getReadySdk(); const slug = "home"; const post = await sdk.getPost({ slug: slug, language_code: context.locale ?? "en", }); if (!post.posts?.data[0].attributes) return { notFound: true }; const props: Props = { ...(await getAppStaticProps(context)), post: post.posts.data[0].attributes, }; return { props: props, }; }