import { Component, OnInit<% if(!!viewEncapsulation) { %>, ViewEncapsulation<% }%><% if(changeDetection !== 'Default') { %>, ChangeDetectionStrategy<% }%>, inject } from '@angular/core';<% if(!modal) { %>
import { ActivatedRoute } from '@angular/router';<% } %>
import { _HttpClient } from '@yelon/theme';
import { NzMessageService } from 'ng-zorro-antd/message';<% if(modal) { %>
import { NzModalRef } from 'ng-zorro-antd/modal';<% } %><% if(standalone) {%>
import { SHARED_IMPORTS } from '@shared';<%}%>

@Component({
  selector: '<%= selector %>',<% if(standalone) {%>
  imports: [...SHARED_IMPORTS],<%}%><% if(inlineTemplate) { %>
  template: ``,<% } else { %>
  templateUrl: './<%= dasherize(name) %>.component.html',<% } if(!inlineStyle) { %><% } else { %>
  styleUrls: ['./<%= dasherize(name) %>.component.<%= style %>']<% } %><% if(!!viewEncapsulation) { %>,
  encapsulation: ViewEncapsulation.<%= viewEncapsulation %><% } if (changeDetection !== 'Default') { %>,
  changeDetection: ChangeDetectionStrategy.<%= changeDetection %><% } %>
})
export class <%= componentName %> implements OnInit {
  private readonly http = inject(_HttpClient);
  private readonly msgSrv = inject(NzMessageService);<% if(modal) { %>
  private readonly modal = inject(NzModalRef);<% } else { %>
  private readonly route = inject(ActivatedRoute);<% } %>

  <% if(modal) { %>record: any = {};<% } else { %>
  id = this.route.snapshot.params.id;<% } %>
  i: any;

  ngOnInit(): void {<% if(modal) { %>
    this.http.get(`/user/${this.record.id}`).subscribe(res => this.i = res);<% } else { %>
    this.http.get(`/user/${this.id}`).subscribe(res => this.i = res);<% } %>
  }<% if(modal) { %>

  close(): void {
    this.modal.destroy();
  }<% } %>
}
