From 4f489a677bb516f0f6105efb05c15474f496f4f8 Mon Sep 17 00:00:00 2001 From: Drew Hess Date: Fri, 14 Jul 2023 16:40:03 +0100 Subject: [PATCH] fix: show more helpful messages when no programs are found Signed-off-by: Drew Hess --- src/components/ChooseSession/index.tsx | 30 ++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/src/components/ChooseSession/index.tsx b/src/components/ChooseSession/index.tsx index 85e27dda..04187a45 100644 --- a/src/components/ChooseSession/index.tsx +++ b/src/components/ChooseSession/index.tsx @@ -1,6 +1,9 @@ import { useState } from "react"; import { useCookies } from "react-cookie"; -import { ExclamationCircleIcon } from "@heroicons/react/24/outline"; +import { + ExclamationCircleIcon, + FaceFrownIcon, +} from "@heroicons/react/24/outline"; import { exampleAccount, SessionList, @@ -119,11 +122,34 @@ const ChooseSession = (): JSX.Element => { />
- {data ? ( + {data && data.items.length > 0 ? ( deleteSession.mutate({ sessionId })} /> + ) : data && sessionNameFilter != "" ? ( +
+
+ ) : data ? ( +
+

+ No programs found +

+

+ You don't have any programs yet. Create a new one! +

+
) : isError ? (