import { PosInfoStore } from '@/domains/pos/store';
import { AppCardComponent } from '@/shared/components';
import { Component, computed, inject } from '@angular/core';
import { Router } from '@angular/router';
import { Message } from 'primeng/message';
import { PosConfigGoldPriceFormComponent } from '../components/goldPrice/form.component';
import { PosConfigPrintFormComponent } from '../components/print/form.component';
import { PosConfigRapidInvoiceFormComponent } from '../components/rapidInvoice/form.component';

@Component({
  selector: 'pos-config-page',
  templateUrl: './root.component.html',
  imports: [
    PosConfigPrintFormComponent,
    AppCardComponent,
    Message,
    PosConfigGoldPriceFormComponent,
    PosConfigRapidInvoiceFormComponent,
  ],
})
export class PosConfigPageComponent {
  private readonly router = inject(Router);
  private readonly posInfoStore = inject(PosInfoStore);

  readonly info = computed(() => this.posInfoStore.entity());

  returnToMainPage() {
    this.router.navigateByUrl('/');
  }
}
