Files
dify/web/features/new-rag/components/knowledge-task-failure.tsx
fd2db63184 feat: KnowledgeFS and New Knowledge (#44165)
Co-authored-by: Jyong <76649700+JohnJyong@users.noreply.github.com>
Co-authored-by: hjlarry <hjlarry@163.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: zhaohao1004 <zhaohao1004@gmail.com>
Co-authored-by: yyh <yuanyouhuilyz@gmail.com>
Co-authored-by: FFXN <lizy@dify.ai>
2026-10-23 03:34:59 +00:00

37 lines
1.2 KiB
TypeScript

import type { KnowledgeFsPublicFailureResponse } from '@dify/contracts/api/console/knowledge-fs/types.gen'
import type { KnowledgeFsTaskFailureMessageKey } from '../knowledge-fs-task-error'
import { Suspense } from 'react'
import { Translation } from 'react-i18next'
import { knowledgeFsTaskFailureDetail } from '../knowledge-fs-task-error'
// Successful task rows never request the failure catalog, on the server or client.
export function KnowledgeTaskFailure({
messageKey,
failure,
}: {
messageKey: KnowledgeFsTaskFailureMessageKey
failure?: KnowledgeFsPublicFailureResponse
}) {
return (
<Suspense fallback={null}>
<Translation ns={['knowledgeErrors']}>
{(t) => {
const detail = knowledgeFsTaskFailureDetail(failure, t)
return (
<>
<p className="mt-1 system-2xs-regular wrap-break-word whitespace-pre-wrap text-text-destructive">
{t(($) => $[messageKey])}
</p>
{detail && (
<p className="mt-0.5 system-2xs-regular wrap-break-word text-text-quaternary">
{detail}
</p>
)}
</>
)
}}
</Translation>
</Suspense>
)
}