import React from 'react' ; import toast from 'react-hot-toast' ; const showToast = ( children ) => { toast ( ( ) => < div style = { { display : 'flex' , flexDirection : 'column' } } > { children } < /div>); } ; export const event = ( name , params ? ) => { showToast ( < > < div > GA : Event < /div> < div > name : { name } < /div> < div > params : { JSON . stringify ( params ) } < /div> < />); } ; export const click = ( name , params ? ) => { showToast ( < > < div > GA : Click < /div> < div > name : { name } < /div> < div > params : { JSON . stringify ( params ) } < /div> < />); } ; export const pageView = ( path , params ? ) => { showToast ( < > < div > GA : PageView < /div> < div > path : { path } < /div> < div > params : { JSON . stringify ( params ) } < /div> < />); } ; export const set = ( ... args ) => { const params = args . pop ( ) ; const name = args . pop ( ) ; showToast ( < > < div > GA : Set < /div> { name && < div > name : { name } < /div>} < div > params : { JSON . stringify ( params ) } < /div> < />); } ; export const exception = ( params ? ) => { showToast ( < > < div > GA : Exception < /div> < div > params : { JSON . stringify ( params ) } < /div> < />); } ; export const setUserProperty = ( params ) => { set ( 'user_properties' , params ) ; } ; export const toaster = { event , click , pageView , set , setUserProperty , exception , } ;