File size: 592 Bytes
3ddd2f7
 
52b4c36
 
edd2230
3ddd2f7
f3a9ef2
3ddd2f7
76fdff4
 
52b4c36
f3a9ef2
3ddd2f7
f3a9ef2
3ddd2f7
 
 
 
 
76fdff4
52b4c36
edd2230
f3a9ef2
edd2230
 
52b4c36
76fdff4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
'use client';

import { nanoid } from '@/lib/utils';
import { Chat } from '@/components/chat';
import { ThemeToggle } from '../../components/theme-toggle';
import { useAtomValue } from 'jotai';
import { datasetAtom } from '../../state';
import { EmptyScreen } from '../../components/empty-screen';

export default function IndexPage() {
	const id = nanoid();
	const dataset = useAtomValue(datasetAtom);

	if (!dataset.length)
		return (
			<div className="pb-[150px] pt-4 md:pt-10 h-full">
				<EmptyScreen />
			</div>
		);

	return (
		<>
			<Chat id={id} />
			<ThemeToggle />
		</>
	);
}