Skip to content

Commit bf751b8

Browse files
committed
fix: add loading state to feed selector
1 parent efaae66 commit bf751b8

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

apps/nextjs/src/app/_components/feed-selector.tsx

+11-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
CommandInput,
1212
CommandList,
1313
} from "@ai-inbox/ui/command";
14+
import { Spinner } from "@ai-inbox/ui/spinner";
1415

1516
import { api } from "~/trpc/react";
1617

@@ -40,7 +41,16 @@ export function FeedSelector({
4041
className="relative max-h-full min-h-0"
4142
scrollShadow="bottom"
4243
>
43-
<CommandEmpty>Nothing found!</CommandEmpty>
44+
{sources.isLoading ? (
45+
<CommandEmpty className="flex justify-center">
46+
<div className="flex items-center gap-2 py-6">
47+
<Spinner />
48+
Loading...
49+
</div>
50+
</CommandEmpty>
51+
) : (
52+
<CommandEmpty>Nothing found!</CommandEmpty>
53+
)}
4454
{sources.data?.map((source) => (
4555
<CommandGroup
4656
key={source.title}

0 commit comments

Comments
 (0)