import {router, usePage} from "@inertiajs/vue3";
import {useToast} from "vue-toastification";

const toast = useToast()

const page = usePage();
export const notifications = ()=>{
    router.on('finish',()=>{
        const message = page.props.message;
        // console.log(message)
        if (message.body){
            toast(message.body, {
                type:message.type
            })
        }
    })
}
