'use client' import type { ReactNode } from 'react' import { cn } from '@langgenius/dify-ui/cn' type DeploymentEmptyStateVariant = 'page' | 'list' | 'section' | 'compact' type DeploymentStateMessageVariant = 'page' | 'list' | 'section' | 'compact' | 'embedded' type DeploymentEmptyStateAlign = 'center' | 'start' type DeploymentEmptyStateProps = { icon?: string title: ReactNode description?: ReactNode action?: ReactNode variant?: DeploymentEmptyStateVariant align?: DeploymentEmptyStateAlign className?: string } type DeploymentStateMessageProps = { children: ReactNode variant?: DeploymentStateMessageVariant className?: string } type DeploymentNoticeStateProps = { children: ReactNode icon?: string className?: string } const emptyStateContainerClassNames: Record = { page: 'col-span-full min-h-80 rounded-xl border border-divider-subtle bg-background-default-subtle px-6 py-12', list: 'min-h-60 rounded-lg border border-divider-subtle bg-background-default-subtle px-6 py-12', section: 'min-h-36 rounded-lg border border-divider-subtle bg-background-default-subtle px-6 py-8', compact: 'min-h-14 rounded-lg border border-divider-subtle bg-background-default-subtle px-3 py-3', } const stateMessageClassNames: Record = { page: 'col-span-full flex min-h-80 items-center justify-center rounded-xl border border-dashed border-divider-subtle bg-background-default-subtle px-6 py-12 text-center system-sm-regular text-text-tertiary', list: 'flex min-h-36 items-center justify-center rounded-lg border border-dashed border-divider-subtle bg-background-default-subtle px-6 py-12 text-center system-sm-regular text-text-tertiary', section: 'flex min-h-24 items-center justify-center rounded-lg border border-dashed border-divider-subtle bg-background-default-subtle px-4 py-6 text-center system-sm-regular text-text-tertiary', compact: 'rounded-lg border border-dashed border-divider-subtle bg-background-default-subtle px-3 py-3 system-sm-regular text-text-tertiary', embedded: 'px-4 py-10 text-center system-sm-regular text-text-tertiary', } export function DeploymentEmptyState({ icon, title, description, action, variant = 'list', align, className, }: DeploymentEmptyStateProps) { const effectiveAlign = align ?? (variant === 'compact' ? 'start' : 'center') const isLarge = variant === 'page' || variant === 'list' const hasDescription = Boolean(description) const hasAction = Boolean(action) const hasIcon = Boolean(icon) return (
{hasIcon && ( )}
{title}
{hasDescription && (

{description}

)} {hasAction && (
{action}
)}
) } export function DeploymentStateMessage({ children, variant = 'list', className, }: DeploymentStateMessageProps) { return (
{children}
) } export function DeploymentNoticeState({ children, icon = 'i-ri-information-line', className, }: DeploymentNoticeStateProps) { return (
) }