/* eslint-disable max-lines */ import { Content, List, Root } from "@radix-ui/react-tabs"; import { useTranslation } from "react-i18next"; import Button from "@/lib/components/ui/Button"; import { BrainTabTrigger, KnowledgeTab, PeopleTab } from "./components"; import { DeleteOrUnsubscribeConfirmationModal } from "./components/Modals/DeleteOrUnsubscribeConfirmationModal"; import { SettingsTab } from "./components/SettingsTab/SettingsTab"; import { useBrainManagementTabs } from "./hooks/useBrainManagementTabs"; export const BrainManagementTabs = (): JSX.Element => { const { t } = useTranslation([ "translation", "config", "delete_or_unsubscribe_from_brain", ]); const { selectedTab, setSelectedTab, brainId, handleUnsubscribeOrDeleteBrain, isDeleteOrUnsubscribeModalOpened, setIsDeleteOrUnsubscribeModalOpened, hasEditRights, isOwnedByCurrentUser, isDeleteOrUnsubscribeRequestPending, } = useBrainManagementTabs(); if (brainId === undefined) { return
; } return ( {hasEditRights && ( <> )}
{isOwnedByCurrentUser ? ( ) : ( )}
void handleUnsubscribeOrDeleteBrain()} isOwnedByCurrentUser={isOwnedByCurrentUser} isDeleteOrUnsubscribeRequestPending={ isDeleteOrUnsubscribeRequestPending } />
); };