Skip to content
Snippets Groups Projects
menu-language-item.tsx 943 B
Newer Older
import {Component, h, Prop, Host} from '@stencil/core';

@Component({
  tag: 'hy-menu-language-item',
  styleUrl: 'menu-language-item.scss',
})
export class SiteLanguage {
  @Prop() abbr: string;
  @Prop() isActive: boolean = false;
  @Prop() isDisabled: boolean = false;
  @Prop() label: string;
  @Prop() langCode: string;
  @Prop() url: string;

  render() {
    return (
      <Host
        class={{
          'is-active': this.isActive,
          'is-disabled': this.isDisabled,
          'hy-menu-language-item': true,
        }}
      >
        <a
          href={this.url}
          class={{
            'is-active': this.isActive,
            'is-disabled': this.isDisabled,
          }}
        >
          <span class={'hy-menu-language-item__label'}>{this.isMobile ? this.abbr : this.label}</span>
        </a>
      </Host>
    );
  }
}