import { Guide } from ".contentlayer/types" ; import Page from "components/pages/guides/[slug]" ; import { getAllGuides , getCurrentGuide } from "lib/get-guides.data" ; import { GetStaticPaths , GetStaticProps , NextPage } from "next" ; interface IProps { currentGuide : Guide ; } const GuidesSlugPage = ( { currentGuide } ) => { return < Page guide = { currentGuide } />; } ; export const getStaticPaths = async ( ) => { return { fallback : false , paths : getAllGuides ( ) . map ( ( guide ) => { return { params : { slug : guide . slug , } , } ; } ) , } ; } ; export const getStaticProps = async ( { params } ) => { const currentGuide = getCurrentGuide ( params ) ; return { props : { currentGuide , } , } ; } ; export default GuidesSlugPage ;