import { PartnerStore } from '@/domains/partner/store/main.store';
import { AppCardComponent, KeyValueComponent } from '@/shared/components';
import { Component, computed, inject, signal } from '@angular/core';
import { PartnerProfileFormComponent } from '../components/form.component';
import { PartnerResetPasswordCardComponent } from '../components/reset-password-card.component';

@Component({
  selector: 'partner-profile',
  templateUrl: './single.component.html',
  imports: [
    AppCardComponent,
    KeyValueComponent,
    PartnerResetPasswordCardComponent,
    PartnerProfileFormComponent,
  ],
})
export class PartnerProfileComponent {
  private readonly store = inject(PartnerStore);

  readonly profile = computed(() => this.store.entity());

  editing = signal(false);

  edit() {
    this.editing.set(true);
  }

  onEditSuccess() {
    this.store.getData();
  }
}
