@@ -4,20 +4,22 @@ import React, { useEffect } from "react";
44import { HumanBlock } from "@/app/[lang]/chatgpt-samples/components/HumanBlock" ;
55import { Avatar , Box } from "@/components/ChakraUI" ;
66import SimpleMarkdown from "@/components/SimpleMarkdown" ;
7- import { ExecutePromptButton } from "@/components/ClickPromptButton" ;
87import { AiBlock } from "@/app/[lang]/chatgpt-samples/components/AiBlock" ;
98import { ChatGptIcon } from "@/components/CustomIcon" ;
109import { StartlingStep } from "@/app/[lang]/chatgpt-startling-by-each-step/[id]/startling.type" ;
1110import { Textarea } from "@chakra-ui/react" ;
1211import { fillStepWithValued , StepDetail } from "@/app/[lang]/chatgpt-startling-by-each-step/[id]/StepDetail" ;
1312import { ResponseSend } from "@/pages/api/chatgpt/chat" ;
13+ import { ExecutePromptButton } from "@/components/ClickPrompt/ExecutePromptButton" ;
1414
1515type StepProps = {
1616 index : number ;
1717 step : StepDetail ;
1818 content : StartlingStep ;
1919 cachedValue : Record < number , any > ;
2020 onCache ?: ( step : number , response : string ) => void ;
21+ conversationId ?: number ;
22+ updateConversationId ?: ( conversationId : number ) => void ;
2123} ;
2224
2325type AskRendererProps = { step : StepDetail ; onAskUpdate : ( ask : string ) => void ; cachedValue : Record < number , any > } ;
@@ -41,7 +43,15 @@ function AskRenderer({ step, onAskUpdate, cachedValue }: AskRendererProps) {
4143 return < SimpleMarkdown content = { step . ask } /> ;
4244}
4345
44- function StartlingStepDetail ( { index, step, content, onCache, cachedValue } : StepProps ) {
46+ function StartlingStepDetail ( {
47+ index,
48+ step,
49+ content,
50+ onCache,
51+ cachedValue,
52+ conversationId,
53+ updateConversationId,
54+ } : StepProps ) {
4555 const [ response , setResponse ] = React . useState < string | undefined > ( undefined ) ;
4656
4757 const handleResponse = ( response : ResponseSend ) => {
@@ -79,7 +89,13 @@ function StartlingStepDetail({ index, step, content, onCache, cachedValue }: Ste
7989 < AskRenderer step = { step } onAskUpdate = { setAsk } cachedValue = { cachedValue } />
8090 </ Box >
8191 </ HumanBlock >
82- < ExecutePromptButton text = { ask } handleResponse = { handleResponse } name = { content . name } />
92+ < ExecutePromptButton
93+ conversationId = { conversationId }
94+ updateConversationId = { updateConversationId }
95+ text = { ask }
96+ handleResponse = { handleResponse }
97+ name = { content . name }
98+ />
8399 < AiBlock direction = 'row' gap = '2' >
84100 < Box >
85101 < ChatGptIcon />
0 commit comments