Skip to content

Commit

Permalink
Fix data extract page rendering (#107)
Browse files Browse the repository at this point in the history
Signed-off-by: Sean Sundberg <[email protected]>
  • Loading branch information
seansund authored Sep 29, 2023
1 parent 40155cb commit 7816ee0
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions src/views/DataExtraction/DataExtraction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,22 @@ const createEmptyDataExtractionValues = (questionLoadable: Loadable<Promise<Data
}

export const DataExtraction: React.FunctionComponent<DataExtractionProps> = () => {

const webChatConfig: WebChatConfig = {
integrationID: '76f5a344-3d6e-4e87-89d4-ec4fb39ee08a', // The ID of this integration.
region: 'us-south', // The region your integration is hosted in.
serviceInstanceID: '683c39a0-98db-4651-b97d-49f770fb058c', // The ID of your service instance.
}

return (
<>
<WebChatContainer config={webChatConfig} />
<DataExtractionInternal />
</>
)
}

const DataExtractionInternal: React.FunctionComponent<DataExtractionProps> = () => {
const questionLoadable = useAtomValue(dataExtractionQuestionAtomLoadable)
const [dataExtraction, setDataExtraction] = useState<DataExtractionValues>(createEmptyDataExtractionValues(questionLoadable))
const [fileStatus, setFileStatus] = useState<'edit' | 'complete' | 'uploading'>('edit')
Expand Down Expand Up @@ -114,12 +130,6 @@ export const DataExtraction: React.FunctionComponent<DataExtractionProps> = () =
setResults(Promise.resolve([]))
}

const webChatConfig: WebChatConfig = {
integrationID: '76f5a344-3d6e-4e87-89d4-ec4fb39ee08a', // The ID of this integration.
region: 'us-south', // The region your integration is hosted in.
serviceInstanceID: '683c39a0-98db-4651-b97d-49f770fb058c', // The ID of your service instance.
}

return (
<div>
<Form onSubmit={handleSubmit}>
Expand Down Expand Up @@ -170,7 +180,6 @@ export const DataExtraction: React.FunctionComponent<DataExtractionProps> = () =
<div><Button kind="tertiary" onClick={handleReset}>Reset</Button> <Button type="submit">Submit</Button></div>
</Stack>
</Form>
<WebChatContainer config={webChatConfig} />
<DataExtractionResults />
</div>
)
Expand Down

0 comments on commit 7816ee0

Please sign in to comment.