/**
 * Made by mkcomponent.sh
*/

import { isPlatformBrowser } from '@angular/common'
import { Component, OnInit, OnChanges, Inject, Input, PLATFORM_ID } from '@angular/core'
import { LocalstorageService } from '@k-core/services/general/storage'

import { UserService }                          from '../../services/svc.user'

@Component({
    moduleId: module.id+ '',
    selector: 'user-loginButton',
    templateUrl: './tpl.loginButton.pug',
    styleUrls: ['sty.loginButton.scss']
})

export class loginButtonComponent {

    // Variables
    @Input('modifier') modifier:string  = ''


    loggedIn: any = false
    isWindow = typeof window !== 'undefined'

    constructor(
        @Inject(PLATFORM_ID) private _platformId,
        public localStorage: LocalstorageService,
        private _user: UserService
    ) {

    }
    
    // Lifehooks
    ngOnInit() {
        

    }
    // Functions

    userCheck() {
        if(isPlatformBrowser(this._platformId)) {
            return !!this.localStorage.getItem('user-key')
        }
    }
}