// Dependencies import { serverSideTranslations } from 'next-i18next/serverSideTranslations' import { postInfo, order } from 'site/prebuild/showcase-paths.mjs' import { getPostIndexPaths, getPostIndexProps } from 'site/components/mdx/posts/utils.mjs' // Hooks import { useTranslation } from 'next-i18next' // Components import Link from 'next/link' import { PageWrapper, ns as pageNs } from 'shared/components/wrappers/page.mjs' import { Pagination } from 'shared/components/navigation/pagination.mjs' // Translation namespaces used on this page const namespaces = [...new Set(['common', 'designs', ...pageNs])] export const PreviewTile = ({ img, slug, title }) => (

{title}

) // const DesignPosts = ({ design, posts }) => { // const { t } = useTranslation(['patterns']) // return ( //
//

// // {t(`${design}.t`)} // //

//
// ) // } const Posts = ({ posts }) => { const previews = [] posts.forEach((post) => { // for (const design of post.designs) { // if (typeof designs[design] === 'undefined') designs[design] = [] // designs[design].push(post) // } previews.push() }) return (
{previews}
) } const ShowcaseIndexPage = ({ posts, page, current, total }) => { const { t } = useTranslation() // const designKeys = useMemo(() => Object.keys(designs).sort(), [designs]) return (
) } export default ShowcaseIndexPage export async function getStaticProps({ locale, params }) { const props = getPostIndexProps(locale, params, order, postInfo) if (props === false) return { notFound: true } return { props: { // designs, ...props, ...(await serverSideTranslations(locale, namespaces)), page: { locale, path: ['showcase'], }, }, } } export const getStaticPaths = async () => { return { paths: getPostIndexPaths(order, 'showcase'), fallback: 'blocking', } }