import { Component } from '@angular/core';
import { FormsModule } from '@angular/forms';

import { NzButtonModule } from 'ng-zorro-antd/button';
import { NzCheckboxModule } from 'ng-zorro-antd/checkbox';

@Component({
  selector: '<%= selector %>',
  imports: [FormsModule, NzButtonModule, NzCheckboxModule],
  <% if(inlineTemplate) { %>template: `
    <label nz-checkbox [(ngModel)]="isCheckedButton" [nzDisabled]="isDisabledButton">
      {{ isCheckedButton ? 'Checked' : 'Unchecked' }} - {{ isDisabledButton ? 'Disabled' : 'Enabled' }}
    </label>
    <br />
    <br />
    <button nz-button [nzType]="'primary'" (click)="checkButton()" [nzSize]="'small'">
      {{ !isCheckedButton ? 'Checked' : 'Unchecked' }}
    </button>
    <button nz-button [nzType]="'primary'" (click)="disableButton()" [nzSize]="'small'">
      {{ isDisabledButton ? 'Enabled' : 'Disabled' }}
    </button>
  `<% } else { %>templateUrl: './<%= dasherize(name) %>.component.html'<% } %>,
  <% if(inlineStyle) { %>styles: [`
      button {
        margin-right: 8px;
      }
    `]<% } else { %>styleUrls: ['./<%= dasherize(name) %>.component.<%= style %>']<% } %>
})
export class <%= classify(name) %>Component {
  isCheckedButton = true;
  isDisabledButton = false;

  checkButton(): void {
    this.isCheckedButton = !this.isCheckedButton;
  }

  disableButton(): void {
    this.isDisabledButton = !this.isDisabledButton;
  }
}
