import {Component, h, Host, Prop} from '@stencil/core';
import {ColorVariant, SiteLogoSize} from '../../../utils/utils';

@Component({
  tag: 'hy-site-logo',
  styleUrl: 'site-logo.scss',
  shadow: true,
})
export class SiteLogo {
  @Prop() color: ColorVariant = ColorVariant.black;
  @Prop() label?: string;
  @Prop() size: SiteLogoSize = SiteLogoSize.big;
  @Prop() url?: string;

  render() {
    return this.url ? (
      <Host class={'hy-site-logo'}>
        <a href={this.url}>
          <hy-icon class={'hy-site-logo__icon'} icon={'hy-icon-hy-logo'} size={this.size} fill={this.color} />
          <span class={'hy-site-logo__label'} style={{color: this.color}}>
            {this.label}
          </span>
        </a>
      </Host>
    ) : this.label ? (
      <Host class={'hy-site-logo'}>
        <hy-icon class={'hy-site-logo__icon'} icon={'hy-icon-hy-logo'} size={this.size} fill={this.color} />
        <span class={'hy-site-logo__label'} style={{color: this.color}}>
          {this.label}
        </span>
      </Host>
    ) : (
      ''
    );
  }
}