import {
	TbCircleCheck,
	TbInfoCircle,
	TbInfoHexagon,
	TbInfoTriangle,
	TbLoader2
} from 'react-icons/tb'

import { ToastType } from '@/types'

export const getToastColor = (type: ToastType) => {
	switch (type) {
		case 'success':
			return 'text-success!'
		case 'info':
			return 'text-info!'
		case 'warning':
			return 'text-warning!'
		case 'error':
			return 'text-danger!'
		case 'loading':
			return 'text-secondary!'
		default:
			return ''
	}
}

export const getToastIcon = (type: ToastType) => {
	switch (type) {
		case 'success':
			return <TbCircleCheck />
		case 'info':
			return <TbInfoCircle />
		case 'warning':
			return <TbInfoTriangle />
		case 'error':
			return <TbInfoHexagon />
		case 'loading':
			return <TbLoader2 className='animate-spin' />
		default:
			return ''
	}
}
