<!--

    Copyright © 2016-2026 The Thingsboard Authors

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

-->
<form class="mat-content mat-padding flex flex-col" [formGroup]="persistentFilterFormGroup" (ngSubmit)="update()">
  <mat-form-field class="mat-block flex-1" floatLabel="always" appearance="outline">
    <mat-label translate>widgets.persistent-table.rpc-status-list</mat-label>
    <mat-select formControlName="rpcStatus"
                placeholder="{{ rpcSearchPlaceholder }}">
      <mat-option [value]="null">
        {{ 'widgets.persistent-table.rpc-search-status-all' | translate }}
      </mat-option>
      @for (searchStatus of persistentSearchStatuses; track searchStatus) {
        <mat-option [value]="searchStatus">
          {{ rpcSearchStatusTranslationMap.get(searchStatus) | translate }}
        </mat-option>
      }
    </mat-select>
  </mat-form-field>
  <div class="tb-panel-actions flex flex-row items-center justify-end">
    <button type="button"
            mat-button
            (click)="cancel()">
      {{ 'action.cancel' | translate }}
    </button>
    <button type="submit"
            mat-raised-button
            color="primary"
            [disabled]="persistentFilterFormGroup.invalid || !persistentFilterFormGroup.dirty">
      {{ 'action.update' | translate }}
    </button>
  </div>
</form>
