-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2005 from stakwork/feature/ai-ux-improvement
feat: improvements for ai flow, bug fixes
- Loading branch information
Showing
13 changed files
with
502 additions
and
439 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
import { Button } from '@mui/material' | ||
import { useNavigate } from 'react-router-dom' | ||
import styled from 'styled-components' | ||
import ArrowBackIcon from '~/components/Icons/ArrowBackIcon' | ||
import { Flex } from '~/components/common/Flex' | ||
import { useAiSummaryStore } from '~/stores/useAiSummaryStore' | ||
import { colors } from '~/utils/colors' | ||
import { AiSearch } from '../AiSearch' | ||
import { AiSummary } from '../AiSummary' | ||
|
||
export const MENU_WIDTH = 390 | ||
|
||
// eslint-disable-next-line react/display-name | ||
export const AiView = () => { | ||
const { aiSummaryAnswers, resetAiSummaryAnswer, newLoading } = useAiSummaryStore((s) => s) | ||
|
||
const handleCloseAi = () => { | ||
resetAiSummaryAnswer() | ||
navigate('/') | ||
} | ||
|
||
const navigate = useNavigate() | ||
|
||
return ( | ||
<Wrapper> | ||
<Flex align="flex-start"> | ||
<Flex p={24}> | ||
<Button onClick={handleCloseAi} startIcon={<ArrowBackIcon />}> | ||
Home | ||
</Button> | ||
</Flex> | ||
</Flex> | ||
<ScrollWrapper> | ||
<Flex> | ||
{Object.keys(aiSummaryAnswers) | ||
.filter((key) => aiSummaryAnswers[key].shouldRender) | ||
.map((i: string) => ( | ||
<AiSummary | ||
key={i} | ||
question={aiSummaryAnswers[i]?.question || ''} | ||
refId={i} | ||
response={aiSummaryAnswers[i]} | ||
/> | ||
))} | ||
{newLoading && <AiSummary question={newLoading.question || ''} refId="" response={newLoading} />} | ||
</Flex> | ||
</ScrollWrapper> | ||
<AiSearch /> | ||
</Wrapper> | ||
) | ||
} | ||
|
||
const Wrapper = styled(Flex)(({ theme }) => ({ | ||
position: 'relative', | ||
background: colors.BG1, | ||
flex: 1, | ||
width: '100%', | ||
zIndex: 30, | ||
[theme.breakpoints.up('sm')]: { | ||
width: MENU_WIDTH, | ||
}, | ||
})) | ||
|
||
const ScrollWrapper = styled(Flex)(() => ({ | ||
overflow: 'auto', | ||
flex: 1, | ||
width: '100%', | ||
})) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.