feat: add loading state for chat components and implement skeleton loading UI

This commit is contained in:
Anish Sarkar 2026-02-04 20:13:33 +05:30
parent d0a490fa50
commit 5e4dce40bd
4 changed files with 39 additions and 3 deletions

View file

@ -88,7 +88,7 @@ export function LayoutDataProvider({
});
// Fetch threads (40 total to allow up to 20 per section - shared/private)
const { data: threadsData } = useQuery({
const { data: threadsData, isPending: isLoadingThreads } = useQuery({
queryKey: ["threads", searchSpaceId, { limit: 40 }],
queryFn: () => fetchThreads(Number(searchSpaceId), 40),
enabled: !!searchSpaceId,
@ -547,6 +547,7 @@ export function LayoutDataProvider({
theme={theme}
setTheme={setTheme}
isChatPage={isChatPage}
isLoadingChats={isLoadingThreads}
inbox={{
isOpen: isInboxSidebarOpen,
onOpenChange: setIsInboxSidebarOpen,