import {
Badge,
Button,
Tooltip,
TooltipArrow,
TooltipContent,
TooltipTrigger,
} from '@janhq/uikit'
import { useAtomValue } from 'jotai'
import { FaGithub, FaDiscord } from 'react-icons/fa'
import DownloadingState from '@/containers/Layout/BottomBar/DownloadingState'
import SystemItem from '@/containers/Layout/BottomBar/SystemItem'
import ProgressBar from '@/containers/ProgressBar'
import { appDownloadProgress } from '@/containers/Providers/Jotai'
import ShortCut from '@/containers/Shortcut'
import { MainViewState } from '@/constants/screens'
import { useActiveModel } from '@/hooks/useActiveModel'
import { useDownloadState } from '@/hooks/useDownloadState'
import { useGetDownloadedModels } from '@/hooks/useGetDownloadedModels'
import useGetSystemResources from '@/hooks/useGetSystemResources'
import { useMainViewState } from '@/hooks/useMainViewState'
const menuLinks = [
{
name: 'Discord',
icon: ,
link: 'https://discord.gg/FTk2MvZwJH',
},
{
name: 'Github',
icon: ,
link: 'https://github.com/janhq/jan',
},
]
const BottomBar = () => {
const { activeModel, stateModel } = useActiveModel()
const { ram, cpu } = useGetSystemResources()
const progress = useAtomValue(appDownloadProgress)
const { downloadedModels } = useGetDownloadedModels()
const { setMainViewState } = useMainViewState()
const { downloadStates } = useDownloadState()
return (
{progress && progress > 0 ? (
) : null}
{stateModel.state === 'start' && stateModel.loading && (
)}
{stateModel.state === 'stop' && stateModel.loading && (
)}
{!stateModel.loading && downloadedModels.length !== 0 && (
to view models
)
}
/>
)}
{downloadedModels.length === 0 &&
!stateModel.loading &&
downloadStates.length === 0 && (
)}
{/* VERSION is defined by webpack, please see next.config.js */}
Jan v{VERSION ?? ''}
{menuLinks
.filter((link) => !!link)
.map((link, i) => (
))}
)
}
export default BottomBar