Skip to content

Open Source Wealth Management Software. Angular + NestJS + Prisma + Nx + TypeScript 🤍

1.5 KB
Raw Blame
<mat-form-field
  appearance="outline"
  class="w-100"
  [class.without-hint]="!hasHint()"
>
  <mat-label>{{ label() }}</mat-label>
  <mat-select
    [errorStateMatcher]="errorStateMatcher"
    [formControl]="control"
    [required]="isRequired()"
    (closed)="onPanelClosed()"
  >
    <mat-select-trigger>
      <div class="align-items-center align-middle d-inline-flex lh-1">
        @if (selectedAccount()?.platform?.url) {
          <gf-entity-logo
            class="me-1"
            [tooltip]="selectedAccount()?.platform?.name ?? ''"
            [url]="selectedAccount()?.platform?.url ?? ''"
          />
        }
        <span>{{ selectedAccount()?.name }}</span>
      </div>
    </mat-select-trigger>

    @if (hasNullOption()) {
      <mat-option [value]="null" />
    }

    @for (account of sortedAccounts(); track account.id) {
      <mat-option [value]="account.id">
        <div class="align-items-center d-flex">
          <gf-entity-logo
            class="me-1"
            [hasPlaceholder]="true"
            [tooltip]="account.platform?.name ?? ''"
            [url]="account.platform?.url ?? ''"
          />
          <div class="lh-1">
            <span>{{ account.name }}</span>
            <br />
            <small class="text-body-secondary">
              @if (account.platform?.name) {
                {{ account.platform?.name }} ·
              }
              {{ account.currency }}</small
            >
          </div>
        </div>
      </mat-option>
    }
  </mat-select>
</mat-form-field>