import { Badge, Button } from '@janhq/uikit' import { useAtomValue } from 'jotai' 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 { MainViewState } from '@/constants/screens' import { useActiveModel } from '@/hooks/useActiveModel' import { useDownloadState } from '@/hooks/useDownloadState' import { useGetAppVersion } from '@/hooks/useGetAppVersion' import { useGetDownloadedModels } from '@/hooks/useGetDownloadedModels' import useGetSystemResources from '@/hooks/useGetSystemResources' import { useMainViewState } from '@/hooks/useMainViewState' const BottomBar = () => { const { activeModel, stateModel } = useActiveModel() const { ram, cpu } = useGetSystemResources() const progress = useAtomValue(appDownloadProgress) const appVersion = useGetAppVersion() 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 && ( ⌘e to show your model ) } /> )} {downloadedModels.length === 0 && !stateModel.loading && downloadStates.length === 0 && ( )}
Jan v{appVersion?.version ?? ''}
) } export default BottomBar