Skip to content

Commit

Permalink
clean up code
Browse files Browse the repository at this point in the history
  • Loading branch information
koji committed May 2, 2024
1 parent bbc967d commit 6a98036
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 64 deletions.
16 changes: 1 addition & 15 deletions opentrons-ai-client/src/molecules/InputPrompt/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import {
TYPOGRAPHY,
} from '@opentrons/components'
import { SendButton } from '../../atoms/SendButton'
// import { useFetch } from '../../resources/hooks'
import { preparedPromptAtom, chatDataAtom } from '../../resources/atoms'

import type { ChatData } from '../../resources/types'
Expand Down Expand Up @@ -44,7 +43,6 @@ export function InputPrompt(): JSX.Element {

const userPrompt = watch('userPrompt') ?? ''

// const { data: responseData, loading, error } = useFetch(userPrompt)
const calcTextAreaHeight = (): number => {
const rowsNum = userPrompt.split('\n').length
return rowsNum
Expand All @@ -55,10 +53,6 @@ export function InputPrompt(): JSX.Element {
setLoading(true)
try {
const response = await axios.post(url, {
// headers: {
// Accept: 'application/json',
// 'Content-Type': 'application/json;charset=UTF-8',
// },
headers: {
'Content-Type': 'application/json',
},
Expand All @@ -75,20 +69,12 @@ export function InputPrompt(): JSX.Element {
}

const handleClick = (): void => {
// const userInput: ChatData = {
// role: 'user',
// content: userPrompt,
// }
// setChatData(chatData => [...chatData, userInput])
// void fetchData(userPrompt)
// setSubmitted(true)
// reset()
const userInput: ChatData = {
role: 'user',
content: userPrompt,
}
setChatData(chatData => [...chatData, userInput])
void fetchData(userPrompt) // Call fetchData here
void fetchData(userPrompt)
setSubmitted(true)
reset()
}
Expand Down
49 changes: 0 additions & 49 deletions opentrons-ai-client/src/resources/hooks.ts

This file was deleted.

0 comments on commit 6a98036

Please sign in to comment.