(message: string, type: 'warn' | 'error' | 'success')
| 1 | import toast from 'react-hot-toast'; |
| 2 | |
| 3 | export const notify = (message: string, type: 'warn' | 'error' | 'success') => { |
| 4 | if (type === 'warn') { |
| 5 | toast(message, { |
| 6 | icon: '⚠️', |
| 7 | style: { |
| 8 | borderRadius: '10px', |
| 9 | background: '#FBBF24', |
| 10 | color: '#1F2937', |
| 11 | }, |
| 12 | }); |
| 13 | } else if (type === 'error') { |
| 14 | toast.error(message, { |
| 15 | style: { |
| 16 | borderRadius: '10px', |
| 17 | background: '#EF4444', |
| 18 | color: '#F3F4F6', |
| 19 | }, |
| 20 | }); |
| 21 | } else if (type === 'success') { |
| 22 | toast.success(message, { |
| 23 | style: { |
| 24 | borderRadius: '10px', |
| 25 | background: '#10B981', |
| 26 | color: '#F3F4F6', |
| 27 | }, |
| 28 | }); |
| 29 | } |
| 30 | }; |
no outgoing calls
no test coverage detected