import { cn } from '@langgenius/dify-ui/cn' import { RiCheckLine, RiCloseLine } from '@remixicon/react' import AppIcon from '@/app/components/base/app-icon' import { Mcp } from '@/app/components/base/icons/src/vender/other' import { shouldUseMcpIcon } from '@/utils/mcp' const iconSizeMap = { xs: 'w-4 h-4 text-base', tiny: 'w-6 h-6 text-base', small: 'w-8 h-8', medium: 'w-9 h-9', large: 'w-10 h-10', } const iconPixelSizeMap = { xs: 16, tiny: 24, small: 32, medium: 36, large: 40, } type IconSize = keyof typeof iconSizeMap const Icon = ({ className, src, installed = false, installFailed = false, size = 'large', }: { className?: string src: | string | { content: string background: string } installed?: boolean installFailed?: boolean size?: IconSize }) => { const iconClassName = 'flex justify-center items-center gap-2 absolute bottom-[-4px] right-[-4px] w-[18px] h-[18px] rounded-full border-2 border-components-panel-bg' if (typeof src === 'object') { return (
) : undefined } />
) } return (
{ currentTarget.style.display = 'none' }} /> {installed && (
)} {installFailed && (
)}
) } export default Icon