import { PropsWithChildren } from 'react'
import { View } from '@tarojs/components'
import Icon, { type IconName } from '@/components/ui/Icon'
import './index.scss'

interface ToastOverlayProps {
  visible: boolean
  icon?: IconName
  className?: string
}

export function ToastOverlay({ visible, icon = 'heart-fill', className = '', children }: PropsWithChildren<ToastOverlayProps>) {
  return (
    <View className={`toast-overlay ${visible ? 'toast-overlay--show' : ''} ${className}`}>
      <Icon name={icon} size={82} />
      {children}
    </View>
  )
}

export default ToastOverlay

