import type { FC } from 'react' import { cn } from '@langgenius/dify-ui/cn' import { Tooltip, TooltipContent, TooltipTrigger } from '@langgenius/dify-ui/tooltip' import * as React from 'react' import { Theme } from '@/types/app' type IconWithTooltipProps = { className?: string popupContent?: string theme: Theme BadgeIconLight: React.ElementType BadgeIconDark: React.ElementType } const IconWithTooltip: FC = ({ className, theme, popupContent, BadgeIconLight, BadgeIconDark, }) => { const isDark = theme === Theme.dark const iconClassName = cn('h-5 w-5', className) const Icon = isDark ? BadgeIconDark : BadgeIconLight const icon = ( ) if (!popupContent) return icon return ( {popupContent} ) } export default React.memo(IconWithTooltip)