// Dependencies
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
import { pages as posts } from 'site/prebuild/blog.mjs'
import { meta } from 'site/prebuild/blog-meta.mjs'
import { cloudflareImageUrl } from 'shared/utils.mjs'
import { nsMerge } from 'shared/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'
// Translation namespaces used on this page
const namespaces = nsMerge('designs', 'sections', pageNs)
// Helper object to order posts
const order = {}
let i = 0 // Avoid posts with same date not showing up
for (const [slug, props] of Object.entries(meta)) {
i++
order[props.d + i] = slug
}
export const recentBlogPosts = Object.keys(order)
.sort()
.reverse()
.slice(0, 2)
.map((d) => order[d])
const textShadow = {
style: {
textShadow:
'1px 1px 1px #000000, -1px -1px 1px #000000, 1px -1px 1px #000000, -1px 1px 1px #000000, 2px 2px 1px #000000',
},
}
/* eslint-disable @next/next/no-img-element */
export const BlogPreview = ({ post }) => (