From afc9504dd25f9f94a220d38941c136b2af5fed0d Mon Sep 17 00:00:00 2001 From: Radiquum Date: Mon, 5 May 2025 23:21:30 +0500 Subject: [PATCH] add empty state if no modpacks is added --- gui/app/page.tsx | 73 +++++++++++++++++++++++++++--------------------- 1 file changed, 41 insertions(+), 32 deletions(-) diff --git a/gui/app/page.tsx b/gui/app/page.tsx index efbff14..426f3c4 100644 --- a/gui/app/page.tsx +++ b/gui/app/page.tsx @@ -5,6 +5,7 @@ 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([]); @@ -21,39 +22,47 @@ export default function Home() { return (
- {packsDataLoading && ( -
- -
- )} - {!packsDataLoading && ( -
- {packsData.map((pack) => { - return ( - - -
- {/* eslint-disable-next-line @next/next/no-img-element */} - -
-

{pack.title}

-

by {pack.author}

+ {!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

-
- - - ); - })} +
+

{pack.modloader}

+

{pack.version}

+ | +

{pack.mods.length} mods

+
+ + + ); + })} +
+ ) : ( +
+ +

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

+
+ ) + ) : ( +
+
)}