import React from 'react';
import { showNotification } from '@mantine/notifications';
import * as Icons from 'feather-icons';

export function notificationSuccess(msg: string)
{
    const WWW_ROOT: string = process.env.REACT_APP_WWW_ROOT!;
    showNotification(
        {
            icon: <img 
            style=
            {{
                backgroundColor: 'lightgreen',
                borderRadius: '16px'
            }} 
            src = {WWW_ROOT+'uploads/check-circle.svg'}/> ,    
            //color: 'green',
            message: msg
        });
}

export function notificationError(msg: string)
{
    const WWW_ROOT: string = process.env.REACT_APP_WWW_ROOT!;
    showNotification(
        {
            icon: <img 
            style=
            {{
                backgroundColor: 'red',
                borderRadius: '16px'
            }} 
            src = {WWW_ROOT+'uploads/x-circle.svg'}/> ,    
            //color: 'green',
            message: msg
        });
}

export function notificationAlert(msg: string)
{
    const WWW_ROOT: string = process.env.REACT_APP_WWW_ROOT!;
    showNotification(
        {
            icon: <img 
            style=
            {{
                backgroundColor: 'orange',
                borderRadius: '16px'
            }} 
            src = {WWW_ROOT+'uploads/alert-circle.svg'}/> ,    
            //color: 'green',
            message: msg
        });
}
