import {ReactNode} from 'react'
import toast from '../toast'

type Props = {
  content: string | ReactNode
  messageType?: string
  duration?: number
  onClose?(): void
}
const messageContentStyle = {
  background: '#fff',
  color: '#000',
  padding: '10px 16px',
  fontSize: '14px',
}
const info = (props: Props): void =>
  toast.message({...props, messageType: 'info', contentStyle: messageContentStyle})
const error = (props: Props): void =>
  toast.message({...props, messageType: 'fail', contentStyle: messageContentStyle})
const success = (props: Props): void =>
  toast.message({...props, messageType: 'success', contentStyle: messageContentStyle})
const warn = (props: Props): void =>
  toast.message({...props, messageType: 'warn', contentStyle: messageContentStyle})

export default {
  info,
  error,
  success,
  warn,
}
