feat: auto disable document ui

This commit is contained in:
Joel
2024-12-10 11:43:31 +08:00
parent ae3eae413f
commit 335e57f3c9
3 changed files with 34 additions and 1 deletions

View File

@ -0,0 +1,29 @@
'use client'
import type { FC } from 'react'
import React from 'react'
import { useTranslation } from 'react-i18next'
import StatusWithAction from './status-with-action'
type Props = {
datasetId: string
}
const AutoDisabledDocument: FC<Props> = ({
datasetId,
}) => {
const { t } = useTranslation()
const data = ['', '']
const hasDisabledDocument = data.length > 0
if (!hasDisabledDocument)
return null
return (
<StatusWithAction
type='info'
description={t('dataset.documentsDisabled', { num: data.length })}
actionText={t('dataset.enable')}
onAction={() => { }}
/>
)
}
export default React.memo(AutoDisabledDocument)