import { CommonModule } from '@angular/common';
import { Component, OnInit, ViewChild, inject } from '@angular/core';
import { STColumn, STComponent } from '@delon/abc/st';
import { SFSchema } from '@delon/form';
import { ModalHelper, _HttpClient } from '@delon/theme';
import { SHARED_IMPORTS } from '@shared';
import { DataVFullScreenComponent } from '../fullscreen/fullscreen.component';

@Component({
    selector: 'data-v-setting',
    standalone: true,
    imports: [DataVFullScreenComponent, CommonModule, ...SHARED_IMPORTS],
    template: ` <div layout-default-header-item-trigger nz-dropdown [nzDropdownMenu]="settingsMenu" nzTrigger="click" nzPlacement="bottomRight">
    <i nz-icon nzType="setting"  [ngStyle]="{'color': 'white'}"></i>
  </div>
  <nz-dropdown-menu #settingsMenu="nzDropdownMenu">
    <div nz-menu style="width: 8rem;">
      <div nz-menu-item>
        <data-v-fullscreen />
      </div>
    </div>
  </nz-dropdown-menu>`
})
export class DataVSettingComponent implements OnInit {
    private readonly http = inject(_HttpClient);
    private readonly modal = inject(ModalHelper);

    currentTime: any;

    ngOnInit(): void {
        this.updateCurrentTime();
        setInterval(() => {
            this.updateCurrentTime();
        }, 1000);
    }

    add(): void {
        // this.modal
        //   .createStatic(FormEditComponent, { i: { id: 0 } })
        //   .subscribe(() => this.st.reload());
    }

    updateCurrentTime() {
        this.currentTime = new Date();
    }
}
