mirror of
https://github.com/langgenius/dify.git
synced 2026-07-24 04:31:07 +08:00
27 lines
791 B
TypeScript
27 lines
791 B
TypeScript
import type { RelatedAppResponse } from '@/models/datasets'
|
|
import * as React from 'react'
|
|
import { useDatasetDetailContextWithSelector } from '@/context/dataset-detail'
|
|
import ApiAccess from './api-access'
|
|
import Statistics from './statistics'
|
|
|
|
type IExtraInfoProps = {
|
|
relatedApps?: RelatedAppResponse
|
|
documentCount?: number
|
|
expand: boolean
|
|
}
|
|
|
|
const ExtraInfo = ({ relatedApps, documentCount, expand }: IExtraInfoProps) => {
|
|
const apiEnabled = useDatasetDetailContextWithSelector((state) => state.dataset?.enable_api)
|
|
|
|
return (
|
|
<>
|
|
{expand && (
|
|
<Statistics expand={expand} documentCount={documentCount} relatedApps={relatedApps} />
|
|
)}
|
|
<ApiAccess expand={expand} apiEnabled={apiEnabled ?? false} />
|
|
</>
|
|
)
|
|
}
|
|
|
|
export default React.memo(ExtraInfo)
|