import React, { useEffect } from 'react'; import { motion } from 'framer-motion'; import { Link } from 'react-router-dom'; import { useStore } from '../src/context/StoreContext'; interface BlogPostLayoutProps { title: string; category: string; date: string; image: string; imageAlt: string; children: React.ReactNode; author?: string; } const BlogPostLayout: React.FC = ({ title, category, date, image, imageAlt, children, author = 'Claudia Knuth', }) => { const { articles } = useStore(); const getArticleHref = (slug: string) => ( slug.startsWith('/editorial/') ? slug : `/editorial/${slug}` ); useEffect(() => { window.scrollTo(0, 0); }, []); const nextArticles = articles.filter(post => post.title !== title).slice(0, 2); return (
{category} {date} by
{title} {imageAlt}
{children}
{nextArticles.length > 0 && (

Read Next

{nextArticles.map((post) => (
{post.title}

{post.title}

{post.category} - {post.date}
))}
)}
Back to Editorial
); }; export default BlogPostLayout;