Skip to content

Commit 4c5f047

Browse files
committed
fix: show more helpful messages when no programs are found
Signed-off-by: Drew Hess <[email protected]>
1 parent 2b0b855 commit 4c5f047

File tree

1 file changed

+28
-2
lines changed

1 file changed

+28
-2
lines changed

src/components/ChooseSession/index.tsx

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import { useState } from "react";
22
import { useCookies } from "react-cookie";
3-
import { ExclamationCircleIcon } from "@heroicons/react/24/outline";
3+
import {
4+
ExclamationCircleIcon,
5+
FaceFrownIcon,
6+
} from "@heroicons/react/24/outline";
47
import {
58
exampleAccount,
69
SessionList,
@@ -119,11 +122,34 @@ const ChooseSession = (): JSX.Element => {
119122
/>
120123
</div>
121124
<div className="max-h-screen overflow-auto rounded-sm bg-grey-primary p-3 shadow-inner">
122-
{data ? (
125+
{data && data.items.length > 0 ? (
123126
<SessionList
124127
sessions={data.items}
125128
onClickDelete={(sessionId) => deleteSession.mutate({ sessionId })}
126129
/>
130+
) : data && sessionNameFilter != "" ? (
131+
<div className="flex min-h-full flex-col items-center justify-center">
132+
<FaceFrownIcon
133+
className="mx-auto h-8 w-8 text-blue-primary"
134+
aria-hidden="true"
135+
/>
136+
<p className="mt-4 text-lg font-semibold leading-6 text-blue-secondary">
137+
No results found
138+
</p>
139+
<p className="mt-2 block text-center text-sm leading-6 text-blue-primary">
140+
No programs found with that name. Please try a different name, or
141+
create a new program.
142+
</p>
143+
</div>
144+
) : data ? (
145+
<div className="flex min-h-full flex-col items-center justify-center">
146+
<p className="mt-4 text-lg font-semibold leading-6 text-blue-secondary">
147+
No programs found
148+
</p>
149+
<p className="mt-2 block text-center text-sm leading-6 text-blue-primary">
150+
You don&apos;t have any programs yet. Create a new one!
151+
</p>
152+
</div>
127153
) : isError ? (
128154
<div className="flex min-h-full flex-col items-center justify-center">
129155
<ExclamationCircleIcon

0 commit comments

Comments
 (0)