|
@@ -9,13 +9,13 @@ import type { IThreadRelationHasId } from '~/features/openai/interfaces/thread-r
|
|
|
import { useCurrentUser } from '~/stores-universal/context';
|
|
import { useCurrentUser } from '~/stores-universal/context';
|
|
|
import loggerFactory from '~/utils/logger';
|
|
import loggerFactory from '~/utils/logger';
|
|
|
|
|
|
|
|
-import type { AiAssistantAccessScope } from '../../../../interfaces/ai-assistant';
|
|
|
|
|
import { AiAssistantShareScope, type AiAssistantHasId } from '../../../../interfaces/ai-assistant';
|
|
import { AiAssistantShareScope, type AiAssistantHasId } from '../../../../interfaces/ai-assistant';
|
|
|
import { determineShareScope } from '../../../../utils/determine-share-scope';
|
|
import { determineShareScope } from '../../../../utils/determine-share-scope';
|
|
|
import { deleteAiAssistant, setDefaultAiAssistant } from '../../../services/ai-assistant';
|
|
import { deleteAiAssistant, setDefaultAiAssistant } from '../../../services/ai-assistant';
|
|
|
import { deleteThread } from '../../../services/thread';
|
|
import { deleteThread } from '../../../services/thread';
|
|
|
import { useAiAssistantSidebar, useAiAssistantManagementModal } from '../../../stores/ai-assistant';
|
|
import { useAiAssistantSidebar, useAiAssistantManagementModal } from '../../../stores/ai-assistant';
|
|
|
import { useSWRMUTxThreads, useSWRxThreads } from '../../../stores/thread';
|
|
import { useSWRMUTxThreads, useSWRxThreads } from '../../../stores/thread';
|
|
|
|
|
+import { getShareScopeIcon } from '../../../utils/get-share-scope-Icon';
|
|
|
|
|
|
|
|
import styles from './AiAssistantTree.module.scss';
|
|
import styles from './AiAssistantTree.module.scss';
|
|
|
|
|
|
|
@@ -125,20 +125,6 @@ const ThreadItems: React.FC<ThreadItemsProps> = ({ aiAssistantData, onThreadClic
|
|
|
/*
|
|
/*
|
|
|
* AiAssistantItem
|
|
* AiAssistantItem
|
|
|
*/
|
|
*/
|
|
|
-const getShareScopeIcon = (shareScope: AiAssistantShareScope, accessScope: AiAssistantAccessScope): string => {
|
|
|
|
|
- const determinedSharedScope = determineShareScope(shareScope, accessScope);
|
|
|
|
|
- switch (determinedSharedScope) {
|
|
|
|
|
- case AiAssistantShareScope.OWNER:
|
|
|
|
|
- return 'lock';
|
|
|
|
|
- case AiAssistantShareScope.GROUPS:
|
|
|
|
|
- return 'account_tree';
|
|
|
|
|
- case AiAssistantShareScope.PUBLIC_ONLY:
|
|
|
|
|
- return 'group';
|
|
|
|
|
- case AiAssistantShareScope.SAME_AS_ACCESS_SCOPE:
|
|
|
|
|
- return '';
|
|
|
|
|
- }
|
|
|
|
|
-};
|
|
|
|
|
-
|
|
|
|
|
type AiAssistantItemProps = {
|
|
type AiAssistantItemProps = {
|
|
|
currentUser?: IUserHasId | null;
|
|
currentUser?: IUserHasId | null;
|
|
|
aiAssistant: AiAssistantHasId;
|
|
aiAssistant: AiAssistantHasId;
|