1+ import { Fragment } from 'react'
2+
3+ import { Badge , Button } from '@janhq/uikit'
4+
15import LogoMark from '@/containers/Brand/Logo/Mark'
26
7+ import { MainViewState } from '@/constants/screens'
8+
9+ import { useActiveModel } from '@/hooks/useActiveModel'
10+ import { useGetDownloadedModels } from '@/hooks/useGetDownloadedModels'
11+
12+ import { useMainViewState } from '@/hooks/useMainViewState'
13+
314const WelcomeScreen = ( ) => {
15+ const { downloadedModels } = useGetDownloadedModels ( )
16+ const { activeModel } = useActiveModel ( )
17+ const { setMainViewState } = useMainViewState ( )
18+
419 return (
520 < div className = "flex h-full items-center justify-center px-4" >
621 < div className = "text-center" >
@@ -9,10 +24,45 @@ const WelcomeScreen = () => {
924 width = { 56 }
1025 height = { 56 }
1126 />
12- < h1 data-testid = "testid-welcome-title" className = "text-2xl font-bold" >
13- Welcome to Jan
14- </ h1 >
15- < p className = "" > { `let’s download your first model` } </ p >
27+
28+ { downloadedModels . length === 0 && ! activeModel && (
29+ < Fragment >
30+ < h1
31+ data-testid = "testid-welcome-title"
32+ className = "text-2xl font-bold"
33+ >
34+ Welcome to Jan
35+ </ h1 >
36+ < p className = "mt-1" > { `let’s download your first model` } </ p >
37+ < Button
38+ className = "mt-4"
39+ onClick = { ( ) => setMainViewState ( MainViewState . ExploreModels ) }
40+ >
41+ Explore Models
42+ </ Button >
43+ </ Fragment >
44+ ) }
45+ { downloadedModels . length >= 1 && ! activeModel && (
46+ < Fragment >
47+ < h1 className = "mt-2 text-lg font-medium" > { `You don’t have any actively running models` } </ h1 >
48+ < p className = "mt-1" > { `Please start a downloaded model in My Models page to use this feature.` } </ p >
49+ < Badge className = "mt-4" themes = "secondary" >
50+ ⌘e to show your model
51+ </ Badge >
52+ </ Fragment >
53+ ) }
54+ { downloadedModels . length >= 1 && activeModel && (
55+ < Fragment >
56+ < h1 className = "mt-2 text-lg font-medium" > { `Your Model is Active` } </ h1 >
57+ < p className = "mt-1" > { `You are ready to start conversations.` } </ p >
58+ < Button
59+ className = "mt-4"
60+ onClick = { ( ) => setMainViewState ( MainViewState . Chat ) }
61+ >
62+ Start a conversation
63+ </ Button >
64+ </ Fragment >
65+ ) }
1666 </ div >
1767 </ div >
1868 )
0 commit comments