<div class="flex flex-col gap-6">
  <app-card-data cardTitle="اطلاعات فعالیت اقتصادی" [editable]="true" [(editMode)]="editMode">
    <ng-template #moreActions>
      <button pButton outlined size="small" (click)="showAccountsChargeDialog()">شارژ کاربر</button>
    </ng-template>
    <div class="flex flex-col gap-4">
      <div class="listKeyValue">
        <app-key-value label="عنوان" [value]="businessActivity()?.name" />
        <app-key-value label="کد اقتصادی" [value]="businessActivity()?.economic_code" />
        <app-key-value label="صنف" [value]="businessActivity()?.guild?.name" />
        <app-key-value label="تاریخ انقضا مجوز" [value]="businessActivity()?.license_info?.expires_at" type="date" />
        <app-key-value label="تعداد کاربران مجاز" [value]="businessActivity()?.license_info?.accounts_limit" />
      </div>
    </div>
  </app-card-data>

  <partner-consumer-complexes-list [consumerId]="consumerId()" [businessId]="businessId()" />

  <partner-consumer-businessActivities-form
    [(visible)]="editMode"
    [editMode]="true"
    [consumerId]="consumerId()"
    [businessActivityId]="businessId()"
    [initialValues]="businessActivity() || undefined"
    (onSubmit)="getData()"
  />
  <partner-charge-account-form-dialog
    [(visible)]="visibleAccountsChargeForm"
    [consumerId]="consumerId()"
    [businessId]="businessId()"
    (onSubmit)="getData()"
  >
  </partner-charge-account-form-dialog>
</div>
