|
@@ -4,11 +4,13 @@ import dynamic from 'next/dynamic';
|
|
|
import { useTranslation } from 'react-i18next';
|
|
import { useTranslation } from 'react-i18next';
|
|
|
|
|
|
|
|
import ItemsTreeContentSkeleton from '~/client/components/ItemsTree/ItemsTreeContentSkeleton';
|
|
import ItemsTreeContentSkeleton from '~/client/components/ItemsTree/ItemsTreeContentSkeleton';
|
|
|
|
|
+import { useIsGuestUser } from '~/stores-universal/context';
|
|
|
|
|
|
|
|
const AiAssistantContent = dynamic(() => import('./AiAssistantSubstance').then(mod => mod.AiAssistantContent), { ssr: false });
|
|
const AiAssistantContent = dynamic(() => import('./AiAssistantSubstance').then(mod => mod.AiAssistantContent), { ssr: false });
|
|
|
|
|
|
|
|
export const AiAssistant = (): JSX.Element => {
|
|
export const AiAssistant = (): JSX.Element => {
|
|
|
const { t } = useTranslation();
|
|
const { t } = useTranslation();
|
|
|
|
|
+ const { data: isGuestUser } = useIsGuestUser();
|
|
|
|
|
|
|
|
return (
|
|
return (
|
|
|
<div className="px-3">
|
|
<div className="px-3">
|
|
@@ -17,9 +19,19 @@ export const AiAssistant = (): JSX.Element => {
|
|
|
{t('Knowledge Assistant')}
|
|
{t('Knowledge Assistant')}
|
|
|
</h3>
|
|
</h3>
|
|
|
</div>
|
|
</div>
|
|
|
- <Suspense fallback={<ItemsTreeContentSkeleton />}>
|
|
|
|
|
- <AiAssistantContent />
|
|
|
|
|
- </Suspense>
|
|
|
|
|
|
|
+
|
|
|
|
|
+ { isGuestUser
|
|
|
|
|
+ ? (
|
|
|
|
|
+ <h4 className="fs-6">
|
|
|
|
|
+ { t('Not available for guest') }
|
|
|
|
|
+ </h4>
|
|
|
|
|
+ )
|
|
|
|
|
+ : (
|
|
|
|
|
+ <Suspense fallback={<ItemsTreeContentSkeleton />}>
|
|
|
|
|
+ <AiAssistantContent />
|
|
|
|
|
+ </Suspense>
|
|
|
|
|
+ )
|
|
|
|
|
+ }
|
|
|
</div>
|
|
</div>
|
|
|
);
|
|
);
|
|
|
};
|
|
};
|