<div class="flex flex-col gap-4">
  <app-card-data cardTitle="اطلاعات پروفایل" [editable]="true" [(editMode)]="editing">
    @if (isLegal()) {
      <div class="grid grid-cols-1 md:grid-cols-2 gap-3">
        <app-key-value label="نام شرکت" [value]="profile()?.legal?.company_name || '-'" />
        <app-key-value label="شماره ثبت" [value]="profile()?.legal?.registration_number" />
      </div>
    } @else {
      <div class="grid grid-cols-1 md:grid-cols-2 gap-3">
        <app-key-value label="نام" [value]="profile()?.individual?.first_name || '-'" />
        <app-key-value label="نام خانوادگی" [value]="profile()?.individual?.last_name || '-'" />
        <app-key-value label="کد ملی" [value]="profile()?.individual?.national_code" />
        <app-key-value label="شماره موبایل" [value]="profile()?.individual?.mobile_number" />
      </div>
    }
  </app-card-data>

  <consumer-reset-password-card />

  @if (editing()) {
    <consumer-profile-form
      [(visible)]="editing"
      [profileType]="profile()!.type!.value"
      [initialValues]="profile()?.legal || profile()?.individual"
      (onSubmit)="onEditSuccess()"
    />
  }
</div>
