chore: document readonly

This commit is contained in:
Joel 2025-10-15 15:27:18 +08:00
parent a8f5748dee
commit 6f4518ebf7

View File

@ -16,7 +16,7 @@ const ConfigDocument: FC = () => {
const { t } = useTranslation() const { t } = useTranslation()
const file = useFeatures(s => s.features.file) const file = useFeatures(s => s.features.file)
const featuresStore = useFeaturesStore() const featuresStore = useFeaturesStore()
const { isShowDocumentConfig } = useContext(ConfigContext) const { isShowDocumentConfig, readonly } = useContext(ConfigContext)
const isDocumentEnabled = file?.allowed_file_types?.includes(SupportUploadFileTypes.document) ?? false const isDocumentEnabled = file?.allowed_file_types?.includes(SupportUploadFileTypes.document) ?? false
@ -64,14 +64,16 @@ const ConfigDocument: FC = () => {
} }
/> />
</div> </div>
<div className='flex shrink-0 items-center'> {!readonly && (
<div className='ml-1 mr-3 h-3.5 w-[1px] bg-divider-subtle'></div> <div className='flex shrink-0 items-center'>
<Switch <div className='ml-1 mr-3 h-3.5 w-[1px] bg-divider-subtle'></div>
defaultValue={isDocumentEnabled} <Switch
onChange={handleChange} defaultValue={isDocumentEnabled}
size='md' onChange={handleChange}
/> size='md'
</div> />
</div>
)}
</div> </div>
) )
} }