feat(focus-modes): Add focus modes

This commit is contained in:
ItzCrazyKns 2024-04-13 12:11:47 +05:30
parent b1f0bdb350
commit 98fae392b7
No known key found for this signature in database
GPG key ID: 8162927C7CCE3065
12 changed files with 1408 additions and 27 deletions

View file

@ -41,6 +41,7 @@ const ChatWindow = () => {
const [messages, setMessages] = useState<Message[]>([]);
const [loading, setLoading] = useState(false);
const [messageAppeared, setMessageAppeared] = useState(false);
const [focusMode, setFocusMode] = useState('webSearch');
const sendMessage = async (message: string) => {
if (loading) return;
@ -55,6 +56,7 @@ const ChatWindow = () => {
JSON.stringify({
type: 'message',
content: message,
focusMode: focusMode,
history: [...chatHistory, ['human', message]],
}),
);
@ -164,7 +166,11 @@ const ChatWindow = () => {
/>
</>
) : (
<EmptyChat sendMessage={sendMessage} />
<EmptyChat
sendMessage={sendMessage}
focusMode={focusMode}
setFocusMode={setFocusMode}
/>
)}
</div>
);