feat: add public chat frontend

This commit is contained in:
CREDO23 2026-01-26 17:08:26 +02:00
parent 9d7259aab9
commit 37adc54d6a
9 changed files with 415 additions and 1 deletions

View file

@ -0,0 +1,14 @@
import { useQuery } from "@tanstack/react-query";
import type { GetPublicChatResponse } from "@/contracts/types/public-chat.types";
import { publicChatApiService } from "@/lib/apis/public-chat-api.service";
import { cacheKeys } from "@/lib/query-client/cache-keys";
export function usePublicChat(shareToken: string) {
return useQuery<GetPublicChatResponse, Error>({
queryKey: cacheKeys.publicChat.byToken(shareToken),
queryFn: () => publicChatApiService.getPublicChat({ share_token: shareToken }),
enabled: !!shareToken,
staleTime: 30_000,
retry: false,
});
}