diff --git a/ui/app/components/stacks/kushagra-first-stack.tsx b/ui/app/components/stacks/kushagra-first-stack.tsx deleted file mode 100644 index 2fcfd8c3..00000000 --- a/ui/app/components/stacks/kushagra-first-stack.tsx +++ /dev/null @@ -1,69 +0,0 @@ -import { useState } from 'react'; -import { IoSend } from 'react-icons/io5'; -import ReactMarkdown from 'react-markdown'; - -export const ChatWithOpenAIStreaming = () => { - const [inputValue, setInputValue] = useState(''); - const [output, setOutput] = useState(''); - const [loading, setLoading] = useState(false); - - const handleSubmit = async (event: React.FormEvent) => { - event.preventDefault(); - console.log('Submitting:', inputValue); - if (inputValue.trim()) { - setOutput(''); - setLoading(true); - - const response = await fetch('/api/boilerplate-basic', { - method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, - body: JSON.stringify({ input: inputValue }), - }); - const data = await response.json(); - console.log('data', data); - setOutput(data.output); - setLoading(false); - } - }; - return ( -
-
-
- setInputValue(e.target.value)} - placeholder="Ask anything..." - className="focus:shadow-outline w-full rounded-full border border-gray-400 py-2 pl-4 pr-10 focus:outline-none" - onKeyDown={(e) => { - if (e.key === 'Enter') - handleSubmit(e as unknown as React.FormEvent); - }} - /> - -
-
-
- {loading ? ( - Generating... - ) : output ? ( - {output} - ) : ( -

Output here...

- )} -
-
- ); -}; - -export default ChatWithOpenAIStreaming; diff --git a/ui/app/components/stacks/kushagra-stack.tsx b/ui/app/components/stacks/kushagra-stack.tsx deleted file mode 100644 index 2fcfd8c3..00000000 --- a/ui/app/components/stacks/kushagra-stack.tsx +++ /dev/null @@ -1,69 +0,0 @@ -import { useState } from 'react'; -import { IoSend } from 'react-icons/io5'; -import ReactMarkdown from 'react-markdown'; - -export const ChatWithOpenAIStreaming = () => { - const [inputValue, setInputValue] = useState(''); - const [output, setOutput] = useState(''); - const [loading, setLoading] = useState(false); - - const handleSubmit = async (event: React.FormEvent) => { - event.preventDefault(); - console.log('Submitting:', inputValue); - if (inputValue.trim()) { - setOutput(''); - setLoading(true); - - const response = await fetch('/api/boilerplate-basic', { - method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, - body: JSON.stringify({ input: inputValue }), - }); - const data = await response.json(); - console.log('data', data); - setOutput(data.output); - setLoading(false); - } - }; - return ( -
-
-
- setInputValue(e.target.value)} - placeholder="Ask anything..." - className="focus:shadow-outline w-full rounded-full border border-gray-400 py-2 pl-4 pr-10 focus:outline-none" - onKeyDown={(e) => { - if (e.key === 'Enter') - handleSubmit(e as unknown as React.FormEvent); - }} - /> - -
-
-
- {loading ? ( - Generating... - ) : output ? ( - {output} - ) : ( -

Output here...

- )} -
-
- ); -}; - -export default ChatWithOpenAIStreaming;