Skip to content

Commit 4d0ae43

Browse files
committed
chore: update steps preview errror
1 parent 878dd13 commit 4d0ae43

File tree

2 files changed

+44
-3
lines changed

2 files changed

+44
-3
lines changed
Lines changed: 29 additions & 0 deletions
Loading

packages/frontend/src/pages/AiBuilder/components/StepsPreview/index.tsx

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
Center,
99
Flex,
1010
HStack,
11+
Image,
1112
Text,
1213
useDisclosure,
1314
VStack,
@@ -22,6 +23,7 @@ import { CREATE_FLOW_WITH_STEPS } from '@/graphql/mutations/create-flow-with-ste
2223
import { GENERATE_AI_STEPS } from '@/graphql/mutations/generate-ai-steps'
2324
import { TOOLBOX_ACTIONS } from '@/helpers/toolbox'
2425
import { useAiBuilderContext } from '@/pages/AiBuilder/AiBuilderContext'
26+
import aiBuilderErrorImg from '@/pages/AiBuilder/assets/AiBuilderError.svg'
2527
import { getPromptFromFormInput } from '@/pages/AiBuilder/helpers'
2628
import { AiFormData } from '@/pages/AiBuilder/schema'
2729

@@ -54,10 +56,11 @@ export default function StepsPreview() {
5456
ddSessionId,
5557
} = useAiBuilderContext()
5658

57-
const [error, setError] = useState<boolean>(false)
5859
const { isOpen, onClose, onOpen } = useDisclosure()
5960
const isMobile = useIsMobile()
6061
const navigate = useNavigate()
62+
const [error, setError] = useState<boolean>(true)
63+
6164
const [createFlowWithSteps, { loading: isCreatingFlow }] = useMutation(
6265
CREATE_FLOW_WITH_STEPS,
6366
)
@@ -190,7 +193,7 @@ export default function StepsPreview() {
190193

191194
if (error) {
192195
return (
193-
<Center h="100%">
196+
<Center h="80%">
194197
<Flex
195198
flexDir="column"
196199
alignItems="center"
@@ -199,8 +202,17 @@ export default function StepsPreview() {
199202
w="100%"
200203
maxW="400px"
201204
>
205+
<Image src={aiBuilderErrorImg} alt="ai-bulilder-error" w="400px" />
202206
<Text textStyle="h4" fontWeight="normal">
203-
Something went wrong
207+
Something went wrong.
208+
</Text>
209+
<Text>Modify your prompt or try again.</Text>
210+
<Text>
211+
If this issue persists,{' '}
212+
<a href={URLS.SUPPORT_FORM_LINK} target="_blank" rel="noreferrer">
213+
contact us
214+
</a>
215+
.
204216
</Text>
205217
<Button onClick={retryGenerateAiSteps}>Try again</Button>
206218
</Flex>

0 commit comments

Comments
 (0)