export default class extends BlazorJSComponents.Component {
    setParameters(IsAuthenticated) {
        const button = document.querySelector('.action-button');
        button.addEventListener('click', () => {
                localStorage.setItem('action', button.id);
                if (IsAuthenticated) {
                    window.location.href = '/chooseinstitut';
                } else {
                    window.location.href = '/MicrosoftIdentity/Account/SignIn';
                }
            }
        )
        const nextMemeButton = document.getElementById('nextmeme');
        const nextMemeImg = document.getElementById('memeImg');
        var random = Math.floor(Math.random() * 100) + 1;
        nextMemeImg.src = "/img/memes/" + random + ".jpg";
        
        nextMemeButton.addEventListener('click', () => {
            random = Math.floor(Math.random() * 100) + 1;
            nextMemeImg.src = "/img/memes/" + random + ".jpg";
        })

    }
}