import type { NextPage } from "next"; import Head from "next/head"; import useSWR from "swr"; import type { ContentList } from "../lib/content/types"; import Navigation from "../components/Blog/Navigation"; import ProjectCard from "../components/Blog/Card"; import Spinner from "../components/Spinner"; import styles from "../styles/Blog/Front.module.scss"; const Blog: NextPage<{}> = () => { const { data: projectList, error } = useSWR("/content/list.json", (...args) => fetch(...args).then(res => res.json())); const generateCards = (type: string) => { if (error) return
Error on fetching projects.
; if (!projectList) return ; else return
{(projectList as ContentList).filter(p => p.type === type).map(p => )}
; }; return <> c0ntroller.de

Hello there!

Miaumiau Lorem ipsum

Projects

{ generateCards("project") }

Diaries

{ generateCards("diary") } ; }; export default Blog;