|
|
|
|
|
|
|
|
'use client' |
|
|
'use client' |
|
|
import React, { FC } from 'react' |
|
|
|
|
|
|
|
|
import type { FC } from 'react' |
|
|
|
|
|
import React from 'react' |
|
|
import { useTranslation } from 'react-i18next' |
|
|
import { useTranslation } from 'react-i18next' |
|
|
import Modal from '@/app/components/base/modal' |
|
|
|
|
|
import FeatureItem from './feature-item' |
|
|
|
|
|
import FeatureGroup from '../feature-group' |
|
|
import FeatureGroup from '../feature-group' |
|
|
import MoreLikeThisIcon from '../../../base/icons/more-like-this-icon' |
|
|
import MoreLikeThisIcon from '../../../base/icons/more-like-this-icon' |
|
|
|
|
|
import FeatureItem from './feature-item' |
|
|
|
|
|
import Modal from '@/app/components/base/modal' |
|
|
import SuggestedQuestionsAfterAnswerIcon from '@/app/components/app/configuration/base/icons/suggested-questions-after-answer-icon' |
|
|
import SuggestedQuestionsAfterAnswerIcon from '@/app/components/app/configuration/base/icons/suggested-questions-after-answer-icon' |
|
|
|
|
|
|
|
|
interface IConfig { |
|
|
|
|
|
|
|
|
type IConfig = { |
|
|
openingStatement: boolean |
|
|
openingStatement: boolean |
|
|
moreLikeThis: boolean |
|
|
moreLikeThis: boolean |
|
|
suggestedQuestionsAfterAnswer: boolean |
|
|
suggestedQuestionsAfterAnswer: boolean |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
export interface IChooseFeatureProps { |
|
|
|
|
|
|
|
|
export type IChooseFeatureProps = { |
|
|
isShow: boolean |
|
|
isShow: boolean |
|
|
onClose: () => void |
|
|
onClose: () => void |
|
|
config: IConfig |
|
|
config: IConfig |
|
|
|
|
|
|
|
|
onClose, |
|
|
onClose, |
|
|
isChatApp, |
|
|
isChatApp, |
|
|
config, |
|
|
config, |
|
|
onChange |
|
|
|
|
|
|
|
|
onChange, |
|
|
}) => { |
|
|
}) => { |
|
|
const { t } = useTranslation() |
|
|
const { t } = useTranslation() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
className='w-[400px]' |
|
|
className='w-[400px]' |
|
|
title={t('appDebug.operation.addFeature')} |
|
|
title={t('appDebug.operation.addFeature')} |
|
|
closable |
|
|
closable |
|
|
|
|
|
overflowVisible |
|
|
> |
|
|
> |
|
|
<div className='pt-5 pb-10'> |
|
|
<div className='pt-5 pb-10'> |
|
|
{/* Chat Feature */} |
|
|
{/* Chat Feature */} |
|
|
|
|
|
|
|
|
<> |
|
|
<> |
|
|
<FeatureItem |
|
|
<FeatureItem |
|
|
icon={OpeningStatementIcon} |
|
|
icon={OpeningStatementIcon} |
|
|
|
|
|
previewImgClassName='openingStatementPreview' |
|
|
title={t('appDebug.feature.conversationOpener.title')} |
|
|
title={t('appDebug.feature.conversationOpener.title')} |
|
|
description={t('appDebug.feature.conversationOpener.description')} |
|
|
description={t('appDebug.feature.conversationOpener.description')} |
|
|
value={config.openingStatement} |
|
|
value={config.openingStatement} |
|
|
onChange={(value) => onChange('openingStatement', value)} |
|
|
|
|
|
|
|
|
onChange={value => onChange('openingStatement', value)} |
|
|
/> |
|
|
/> |
|
|
<FeatureItem |
|
|
<FeatureItem |
|
|
icon={<SuggestedQuestionsAfterAnswerIcon />} |
|
|
icon={<SuggestedQuestionsAfterAnswerIcon />} |
|
|
|
|
|
previewImgClassName='suggestedQuestionsAfterAnswerPreview' |
|
|
title={t('appDebug.feature.suggestedQuestionsAfterAnswer.title')} |
|
|
title={t('appDebug.feature.suggestedQuestionsAfterAnswer.title')} |
|
|
description={t('appDebug.feature.suggestedQuestionsAfterAnswer.description')} |
|
|
description={t('appDebug.feature.suggestedQuestionsAfterAnswer.description')} |
|
|
value={config.suggestedQuestionsAfterAnswer} |
|
|
value={config.suggestedQuestionsAfterAnswer} |
|
|
onChange={(value) => onChange('suggestedQuestionsAfterAnswer', value)} |
|
|
|
|
|
|
|
|
onChange={value => onChange('suggestedQuestionsAfterAnswer', value)} |
|
|
/> |
|
|
/> |
|
|
</> |
|
|
</> |
|
|
</FeatureGroup> |
|
|
</FeatureGroup> |
|
|
|
|
|
|
|
|
<> |
|
|
<> |
|
|
<FeatureItem |
|
|
<FeatureItem |
|
|
icon={<MoreLikeThisIcon />} |
|
|
icon={<MoreLikeThisIcon />} |
|
|
|
|
|
previewImgClassName='moreLikeThisPreview' |
|
|
title={t('appDebug.feature.moreLikeThis.title')} |
|
|
title={t('appDebug.feature.moreLikeThis.title')} |
|
|
description={t('appDebug.feature.moreLikeThis.description')} |
|
|
description={t('appDebug.feature.moreLikeThis.description')} |
|
|
value={config.moreLikeThis} |
|
|
value={config.moreLikeThis} |
|
|
onChange={(value) => onChange('moreLikeThis', value)} |
|
|
|
|
|
|
|
|
onChange={value => onChange('moreLikeThis', value)} |
|
|
/> |
|
|
/> |
|
|
</> |
|
|
</> |
|
|
</FeatureGroup> |
|
|
</FeatureGroup> |