Browse Source

fix: add collapse icon for fullscreen toggle in segment detail compon… (#14530)

tags/1.0.1
Wu Tianwei 8 months ago
parent
commit
de824d3713
No account linked to committer's email address

+ 2
- 1
web/app/components/datasets/documents/detail/completed/child-segment-detail.tsx View File

import { useTranslation } from 'react-i18next' import { useTranslation } from 'react-i18next'
import { import {
RiCloseLine, RiCloseLine,
RiCollapseDiagonalLine,
RiExpandDiagonalLine, RiExpandDiagonalLine,
} from '@remixicon/react' } from '@remixicon/react'
import ActionButtons from './common/action-buttons' import ActionButtons from './common/action-buttons'
</> </>
)} )}
<div className='w-8 h-8 flex justify-center items-center p-1.5 cursor-pointer mr-1' onClick={toggleFullScreen}> <div className='w-8 h-8 flex justify-center items-center p-1.5 cursor-pointer mr-1' onClick={toggleFullScreen}>
<RiExpandDiagonalLine className='w-4 h-4 text-text-tertiary' />
{fullScreen ? <RiCollapseDiagonalLine className='w-4 h-4 text-text-tertiary' /> : <RiExpandDiagonalLine className='w-4 h-4 text-text-tertiary' />}
</div> </div>
<div className='w-8 h-8 flex justify-center items-center p-1.5 cursor-pointer' onClick={onCancel}> <div className='w-8 h-8 flex justify-center items-center p-1.5 cursor-pointer' onClick={onCancel}>
<RiCloseLine className='w-4 h-4 text-text-tertiary' /> <RiCloseLine className='w-4 h-4 text-text-tertiary' />

+ 3
- 2
web/app/components/datasets/documents/detail/completed/segment-detail.tsx View File

import { useTranslation } from 'react-i18next' import { useTranslation } from 'react-i18next'
import { import {
RiCloseLine, RiCloseLine,
RiCollapseDiagonalLine,
RiExpandDiagonalLine, RiExpandDiagonalLine,
} from '@remixicon/react' } from '@remixicon/react'
import { useDocumentContext } from '../index' import { useDocumentContext } from '../index'
docForm, docForm,
}) => { }) => {
const { t } = useTranslation() const { t } = useTranslation()
const [question, setQuestion] = useState(segInfo?.content || '')
const [question, setQuestion] = useState(isEditMode ? segInfo?.content || '' : segInfo?.sign_content || '')
const [answer, setAnswer] = useState(segInfo?.answer || '') const [answer, setAnswer] = useState(segInfo?.answer || '')
const [keywords, setKeywords] = useState<string[]>(segInfo?.keywords || []) const [keywords, setKeywords] = useState<string[]>(segInfo?.keywords || [])
const { eventEmitter } = useEventEmitterContextContext() const { eventEmitter } = useEventEmitterContextContext()
</> </>
)} )}
<div className='w-8 h-8 flex justify-center items-center p-1.5 cursor-pointer mr-1' onClick={toggleFullScreen}> <div className='w-8 h-8 flex justify-center items-center p-1.5 cursor-pointer mr-1' onClick={toggleFullScreen}>
<RiExpandDiagonalLine className='w-4 h-4 text-text-tertiary' />
{fullScreen ? <RiCollapseDiagonalLine className='w-4 h-4 text-text-tertiary' /> : <RiExpandDiagonalLine className='w-4 h-4 text-text-tertiary' />}
</div> </div>
<div className='w-8 h-8 flex justify-center items-center p-1.5 cursor-pointer' onClick={onCancel}> <div className='w-8 h-8 flex justify-center items-center p-1.5 cursor-pointer' onClick={onCancel}>
<RiCloseLine className='w-4 h-4 text-text-tertiary' /> <RiCloseLine className='w-4 h-4 text-text-tertiary' />

Loading…
Cancel
Save