import {
MainViewState,
getMainViewStateAtom,
setMainViewStateAtom,
} from '@helpers/atoms/MainView.atom'
import CompactLogo from '../../../containers/Logo/CompactLogo'
import {
ChatBubbleOvalLeftEllipsisIcon,
Cog8ToothIcon,
CpuChipIcon,
CubeTransparentIcon,
Squares2X2Icon,
} from '@heroicons/react/24/outline'
import { useAtomValue, useSetAtom } from 'jotai'
import { showingBotListModalAtom } from '@helpers/atoms/Modal.atom'
import { useGetDownloadedModels } from '@hooks/useGetDownloadedModels'
import useGetBots from '@hooks/useGetBots'
import { Icons, Toggle } from '@uikit'
const menu = [
// {
// name: 'Explore Models',
// icon: ,
// state: MainViewState.ExploreModel,
// },
{
name: 'My Models',
icon: ,
state: MainViewState.MyModel,
},
{
name: 'Settings',
icon: ,
state: MainViewState.Setting,
},
]
const LeftRibbonNav: React.FC = () => {
const currentState = useAtomValue(getMainViewStateAtom)
const setMainViewState = useSetAtom(setMainViewStateAtom)
const setBotListModal = useSetAtom(showingBotListModalAtom)
const { downloadedModels } = useGetDownloadedModels()
const { getAllBots } = useGetBots()
const onMenuClick = (mainViewState: MainViewState) => {
if (currentState === mainViewState) return
setMainViewState(mainViewState)
}
const isConversationView = currentState === MainViewState.Conversation
const bgColor = isConversationView ? 'bg-gray-500' : ''
const onConversationClick = () => {
// if (currentState === MainViewState.Conversation) return
setMainViewState(MainViewState.Conversation)
}
const onBotListClick = async () => {
const bots = await getAllBots()
if (bots?.length === 0) {
alert('You have no bot')
return
}
if (downloadedModels.length === 0) {
alert('You have no model downloaded')
return
}
setBotListModal(true)
}
return (
)
}
export default LeftRibbonNav