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

import { NzIconModule } from 'ng-zorro-antd/icon';
import { NzInputModule, NzInputSearchEvent } from 'ng-zorro-antd/input';

@Component({
  selector: '<%= selector %>',
  imports: [FormsModule, NzInputModule, NzIconModule],
  <% if(inlineTemplate) { %>template: `
    <nz-input-search (nzSearch)="onSearch($event)">
      <input nz-input [(ngModel)]="value" placeholder="input search text" />
    </nz-input-search>
    <br />
    <br />
    <nz-input-search nzAllowClear (nzSearch)="onSearch($event)">
      <input nz-input [(ngModel)]="value" placeholder="input search text" />
    </nz-input-search>
    <br />
    <br />
    <nz-input-search (nzSearch)="onSearch($event)">
      <span nzInputAddonBefore>https://</span>
      <input nz-input [(ngModel)]="value" placeholder="input search text" />
    </nz-input-search>
    <br />
    <br />
    <nz-input-search nzEnterButton="Submit" (nzSearch)="onSearch($event)">
      <input nz-input [(ngModel)]="value" placeholder="input search text" />
    </nz-input-search>
    <br />
    <br />
    <nz-input-search nzEnterButton="Submit" (nzSearch)="onSearch($event)">
      <input nz-input [(ngModel)]="value" placeholder="input search text" nzSize="large" />
    </nz-input-search>
    <br />
    <br />
    <nz-input-search (nzSearch)="onSearch($event)">
      <input nz-input [(ngModel)]="value" placeholder="input search text" nzSize="large" />
      <nz-icon nzInputSuffix nzType="audio" [style.font-size.px]="16" [style.color]="'#1677ff'" />
      <span nzInputSearchEnterButton>Custom</span>
    </nz-input-search>
  `<% } else { %>templateUrl: './<%= dasherize(name) %>.component.html'<% } %>
})
export class <%= classify(name) %>Component {
  readonly value = signal('');

  onSearch(event: NzInputSearchEvent): void {
    console.log(event);
  }
}
