<!--

    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.

-->
<div class="tb-form-panel no-border no-padding" [class.disabled]="disabled" [formGroup]="alarmRuleFormGroup">
  <tb-cf-alarm-rule-condition formControlName="condition" [arguments]="arguments" [required]="required" [testScript]="testScript" [isClearCondition]="isClearCondition">
  </tb-cf-alarm-rule-condition>
  <div class="tb-form-row space-between column-xs">
    <div class="min-w-40 xs:min-w-fit" tb-hint-tooltip-icon="{{'alarm-rule.alarm-rule-additional-info-icon-hint' | translate }}" translate>
      alarm-rule.alarm-rule-additional-info
    </div>
    <mat-form-field class="flex-1" appearance="outline" subscriptSizing="dynamic">
      <input matInput formControlName="alarmDetails" placeholder="{{ 'action.set' | translate }}">
      <button type="button"
              matSuffix mat-icon-button aria-label="Open in new"
              (click)="openEditDetailsDialog($event)">
        <mat-icon class="material-icons">open_in_new</mat-icon>
      </button>
    </mat-form-field>
  </div>
  <div class="tb-form-row space-between column-xs">
    <div class="min-w-40 xs:min-w-fit" tb-hint-tooltip-icon="{{'alarm-rule.alarm-rule-mobile-dashboard-hint' | translate}}" translate>
      alarm-rule.alarm-rule-mobile-dashboard
    </div>
    <tb-dashboard-autocomplete appearance="outline"
                               subscriptSizing="dynamic"
                               inlineField
                               class="flex-1"
                               placeholder="{{ 'action.set' | translate }}"
                               formControlName="dashboardId">
    </tb-dashboard-autocomplete>
  </div>
</div>
