import bell from "assets/audios/notification-bell.wav" ; type OptionProps = { mute ? : boolean ; } & NotificationOptions ; export const useNotification = ( constantOptions ? , notify ? ) => { return function ( title , options , audioSrc ? ) { const defaultOptions = { ... constantOptions , ... options , silent : true , } ; if ( ! constantOptions ?. mute ) { new Audio ( bell ) . play ( ) ; if ( audioSrc ) { setTimeout ( ( ) => { new Audio ( audioSrc ) . play ( ) ; } , 1500 ) ; } } if ( ! notify ) return ; return new window . Notification ( title , defaultOptions ) ; } ; } ;