| import Button from '@/app/components/base/button' | import Button from '@/app/components/base/button' | ||||
| import Divider from '@/app/components/base/divider' | import Divider from '@/app/components/base/divider' | ||||
| import ConfirmAddVar from '@/app/components/app/configuration/config-prompt/confirm-add-var' | import ConfirmAddVar from '@/app/components/app/configuration/config-prompt/confirm-add-var' | ||||
| import PromptEditor from '@/app/components/base/prompt-editor' | |||||
| import type { OpeningStatement } from '@/app/components/base/features/types' | import type { OpeningStatement } from '@/app/components/base/features/types' | ||||
| import { getInputKeys } from '@/app/components/base/block-input' | import { getInputKeys } from '@/app/components/base/block-input' | ||||
| import type { PromptVariable } from '@/models/debug' | import type { PromptVariable } from '@/models/debug' | ||||
| <div>·</div> | <div>·</div> | ||||
| <div>{tempSuggestedQuestions.length}/{MAX_QUESTION_NUM}</div> | <div>{tempSuggestedQuestions.length}/{MAX_QUESTION_NUM}</div> | ||||
| </div> | </div> | ||||
| <Divider bgStyle='gradient' className='ml-3 h-px w-0 grow'/> | |||||
| <Divider bgStyle='gradient' className='ml-3 h-px w-0 grow' /> | |||||
| </div> | </div> | ||||
| <ReactSortable | <ReactSortable | ||||
| className="space-y-1" | className="space-y-1" | ||||
| > | > | ||||
| <div className='mb-6 flex items-center justify-between'> | <div className='mb-6 flex items-center justify-between'> | ||||
| <div className='title-2xl-semi-bold text-text-primary'>{t('appDebug.feature.conversationOpener.title')}</div> | <div className='title-2xl-semi-bold text-text-primary'>{t('appDebug.feature.conversationOpener.title')}</div> | ||||
| <div className='cursor-pointer p-1' onClick={onCancel}><RiCloseLine className='h-4 w-4 text-text-tertiary'/></div> | |||||
| <div className='cursor-pointer p-1' onClick={onCancel}><RiCloseLine className='h-4 w-4 text-text-tertiary' /></div> | |||||
| </div> | </div> | ||||
| <div className='mb-8 flex gap-2'> | <div className='mb-8 flex gap-2'> | ||||
| <div className='mt-1.5 h-8 w-8 shrink-0 rounded-lg border-components-panel-border bg-util-colors-orange-dark-orange-dark-500 p-1.5'> | <div className='mt-1.5 h-8 w-8 shrink-0 rounded-lg border-components-panel-border bg-util-colors-orange-dark-orange-dark-500 p-1.5'> | ||||
| <RiAsterisk className='h-5 w-5 text-text-primary-on-surface' /> | <RiAsterisk className='h-5 w-5 text-text-primary-on-surface' /> | ||||
| </div> | </div> | ||||
| <div className='grow rounded-2xl border-t border-divider-subtle bg-chat-bubble-bg p-3 shadow-xs'> | <div className='grow rounded-2xl border-t border-divider-subtle bg-chat-bubble-bg p-3 shadow-xs'> | ||||
| <textarea | |||||
| <PromptEditor | |||||
| value={tempValue} | value={tempValue} | ||||
| rows={3} | |||||
| onChange={e => setTempValue(e.target.value)} | |||||
| className="system-md-regular w-full border-0 bg-transparent px-0 text-text-secondary focus:outline-none" | |||||
| onChange={setTempValue} | |||||
| placeholder={t('appDebug.openingStatement.placeholder') as string} | placeholder={t('appDebug.openingStatement.placeholder') as string} | ||||
| variableBlock={{ | |||||
| show: true, | |||||
| variables: [ | |||||
| // Prompt variables | |||||
| ...promptVariables.map(item => ({ | |||||
| name: item.name || item.key, | |||||
| value: item.key, | |||||
| })), | |||||
| // Workflow variables | |||||
| ...workflowVariables.map(item => ({ | |||||
| name: item.variable, | |||||
| value: item.variable, | |||||
| })), | |||||
| ], | |||||
| }} | |||||
| /> | /> | ||||
| {renderQuestions()} | {renderQuestions()} | ||||
| </div> | </div> |