import Layout from "@/components/Layout"; import { GetStaticProps, InferGetStaticPropsType } from "next"; import { Recipe } from "types/recipes"; import { Subtitle } from 'components/Typography'; import RecipeItem from "components/RecipeItem"; import { TextInput } from "@/components/Forms"; export const getStaticProps = async () => { const res = await fetch("http://localhost:3000/recipes/all/"); const recipeList: Recipe[] = await res.json(); return { props: { recipeList, }, }; }; const Recipes = ({ recipeList = [], }: InferGetStaticPropsType) => { return (
Favorites
All {recipeList.map((recipe, index) => ( console.log(recipe.name)} /> ))}
); }; export default Recipes;