dify/web/features/deployments/create-release/ui/content-feedback.tsx
Stephen Zhou a14310fc62
refactor(web): organize deployment feature state (#38065)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
2026-06-27 07:34:46 +00:00

36 lines
1.3 KiB
TypeScript

'use client'
import { useAtomValue } from 'jotai'
import { useTranslation } from 'react-i18next'
import { UnsupportedDslNodesAlert } from '../../shared/components/unsupported-dsl-nodes-alert'
import {
createReleaseContentCheckFailedAtom,
createReleaseMatchedReleaseAtom,
createReleaseUnsupportedDslNodesAtom,
} from '../state'
export function ReleaseContentFeedback() {
const { t } = useTranslation('deployments')
const unsupportedDslNodes = useAtomValue(createReleaseUnsupportedDslNodesAtom)
const matchedRelease = useAtomValue(createReleaseMatchedReleaseAtom)
const releaseContentCheckFailed = useAtomValue(createReleaseContentCheckFailedAtom)
return (
<>
<UnsupportedDslNodesAlert nodes={unsupportedDslNodes} />
{matchedRelease && (
<div role="alert" className="rounded-lg border border-util-colors-warning-warning-200 bg-util-colors-warning-warning-50 px-3 py-2 system-sm-regular text-util-colors-warning-warning-700">
{t('versions.releaseAlreadyExists', { name: matchedRelease.displayName })}
</div>
)}
{releaseContentCheckFailed && (
<div role="alert" className="rounded-lg border border-util-colors-red-red-200 bg-util-colors-red-red-50 px-3 py-2 system-sm-regular text-util-colors-red-red-700">
{t('versions.releaseContentCheckFailed')}
</div>
)}
</>
)
}