"use client"; import { PACK_ENDPOINT, PACKS_ENDPOINT } from "@/api/ENDPOINTS"; import { Pack } from "@/types/pack"; import { Card, Spinner } from "flowbite-react"; import Link from "next/link"; import { useEffect, useState } from "react"; import { GiTumbleweed } from "react-icons/gi"; export default function Home() { const [packsData, setPacksData] = useState([]); const [packsDataLoading, setPacksDataLoading] = useState(true); useEffect(() => { async function _getPacksData() { const res = await fetch(PACKS_ENDPOINT("getPacks")); setPacksData(await res.json()); setPacksDataLoading(false); } _getPacksData(); }, []); return (
{!packsDataLoading ? ( packsData.length > 0 ? (
{packsData.map((pack) => { return (
{/* eslint-disable-next-line @next/next/no-img-element */}

{pack.title}

by {pack.author}

{pack.modloader}

{pack.version}

|

{pack.mods.length} mods

); })}
) : (

Nothing but weeds here... try to create a new pack

) ) : (
)}
); }