Skip to content

Commit 00a6270

Browse files
committed
Use ClientOnly
1 parent 69de253 commit 00a6270

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

apps/webapp/app/components/AskAI.tsx

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import {
3030
TooltipProvider,
3131
TooltipTrigger,
3232
} from "./primitives/Tooltip";
33+
import { ClientOnly } from "remix-utils/client-only";
3334

3435
function useKapaWebsiteId() {
3536
const routeMatch = useTypedRouteLoaderData<typeof loader>("root");
@@ -44,7 +45,23 @@ export function AskAI() {
4445
return null;
4546
}
4647

47-
return <AskAIProvider websiteId={websiteId} />;
48+
return (
49+
<ClientOnly
50+
fallback={
51+
<Button
52+
variant="small-menu-item"
53+
data-action="ask-ai"
54+
hideShortcutKey
55+
data-modal-override-open-class-ask-ai="true"
56+
disabled
57+
>
58+
<AISparkleIcon className="size-5" />
59+
</Button>
60+
}
61+
>
62+
{() => <AskAIProvider websiteId={websiteId} />}
63+
</ClientOnly>
64+
);
4865
}
4966

5067
type AskAIProviderProps = {

0 commit comments

Comments
 (0)