import { getProjects } from '../utils/projects'; import { getBlogPosts } from '../utils/blog'; import { GetStaticProps } from 'next'; import { Wrapper } from '../styles/home'; import Hero from '../components/Hero'; import Button from '../components/Button'; import Card from '../components/Card'; import Head from 'next/head'; interface Props { blogPosts: { title: string; author: string; description: string; slug: string; date: string; tags?: string[]; }[]; projects: { title: string; description: string; slug: string; date: string; tags?: string[]; }[]; } const Index = ({ blogPosts, projects }: Props) => { return ( <> Hazem Krimi

About

Experienced Full Stack developer with a focus on building user-friendly web and cross-platform mobile applications using cutting-edge technologies. Passionate about ongoing learning and staying up-to-date with the latest trends in software engineering.

{projects.length !== 0 && ( <>

Projects

{projects.slice(0, 3).map(({ slug, ...rest }) => ( ))}
)} {blogPosts.length !== 0 && ( <>

Blog

{blogPosts.slice(0, 3).map(({ slug, ...rest }) => ( ))}
)}
); }; export default Index; export const getStaticProps: GetStaticProps = async () => { const blogPosts = getBlogPosts(); const projects = getProjects(); return { props: { blogPosts, projects } }; };