Commit 1610f599 authored by JzoNg's avatar JzoNg

fix: hide Q&A switch in economical type

parent 3f9d7f1c
...@@ -346,6 +346,13 @@ const StepTwo = ({ ...@@ -346,6 +346,13 @@ const StepTwo = ({
setDocForm(DocForm.TEXT) setDocForm(DocForm.TEXT)
} }
const changeToEconomicalType = () => {
if (!hasSetIndexType) {
setIndexType(IndexingType.ECONOMICAL)
setDocForm(DocForm.TEXT)
}
}
const previewSwitch = async () => { const previewSwitch = async () => {
setPreviewSwitched(true) setPreviewSwitched(true)
if (segmentationType === SegmentType.AUTO) if (segmentationType === SegmentType.AUTO)
...@@ -545,7 +552,7 @@ const StepTwo = ({ ...@@ -545,7 +552,7 @@ const StepTwo = ({
hasSetIndexType && s.disabled, hasSetIndexType && s.disabled,
hasSetIndexType && '!w-full', hasSetIndexType && '!w-full',
)} )}
onClick={() => !hasSetIndexType && setIndexType(IndexingType.ECONOMICAL)} onClick={changeToEconomicalType}
> >
<span className={cn(s.typeIcon, s.economical)} /> <span className={cn(s.typeIcon, s.economical)} />
{!hasSetIndexType && <span className={cn(s.radio)} />} {!hasSetIndexType && <span className={cn(s.radio)} />}
...@@ -564,7 +571,7 @@ const StepTwo = ({ ...@@ -564,7 +571,7 @@ const StepTwo = ({
<Link className='text-[#155EEF]' href={`/datasets/${datasetId}/settings`}>{t('datasetCreation.stepTwo.datasetSettingLink')}</Link> <Link className='text-[#155EEF]' href={`/datasets/${datasetId}/settings`}>{t('datasetCreation.stepTwo.datasetSettingLink')}</Link>
</div> </div>
)} )}
{(!hasSetIndexType || (hasSetIndexType && indexingType === IndexingType.QUALIFIED)) && ( {indexType === IndexingType.QUALIFIED && (
<div className='flex justify-between items-center mt-3 px-5 py-4 rounded-xl bg-gray-50 border border-gray-100'> <div className='flex justify-between items-center mt-3 px-5 py-4 rounded-xl bg-gray-50 border border-gray-100'>
<div className='flex justify-center items-center w-8 h-8 rounded-lg bg-indigo-50'> <div className='flex justify-center items-center w-8 h-8 rounded-lg bg-indigo-50'>
<MessageChatSquare className='w-4 h-4' /> <MessageChatSquare className='w-4 h-4' />
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment