<!--

    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 [formGroup]="snmpDeviceProfileTransportConfigurationFormGroup" style="padding: 8px 0 16px;">
  <section class="flex flex-row gap-2 xs:flex-col">
    <mat-form-field class="flex-1" appearance="outline">
      <mat-label translate>device-profile.snmp.timeout-ms</mat-label>
      <input matInput formControlName="timeoutMs" type="number" min="0" required/>
      @if (snmpDeviceProfileTransportConfigurationFormGroup.get('timeoutMs').hasError('required')) {
        <mat-error>{{ 'device-profile.snmp.timeout-ms-required' | translate }}</mat-error>
      }
      @if (snmpDeviceProfileTransportConfigurationFormGroup.get('timeoutMs').hasError('pattern') ||
      snmpDeviceProfileTransportConfigurationFormGroup.get('timeoutMs').hasError('min')) {
        <mat-error>{{ 'device-profile.snmp.timeout-ms-invalid-format' | translate }}</mat-error>
      }
    </mat-form-field>
    <mat-form-field class="flex-1" appearance="outline">
      <mat-label translate>device-profile.snmp.retries</mat-label>
      <input matInput formControlName="retries" type="number" min="0" required/>
      @if (snmpDeviceProfileTransportConfigurationFormGroup.get('retries').hasError('required')) {
        <mat-error>{{ 'device-profile.snmp.retries-required' | translate }}</mat-error>
      }
      @if (snmpDeviceProfileTransportConfigurationFormGroup.get('retries').hasError('pattern') ||
      snmpDeviceProfileTransportConfigurationFormGroup.get('retries').hasError('min')) {
        <mat-error>{{ 'device-profile.snmp.retries-invalid-format' | translate }}</mat-error>
      }
    </mat-form-field>
  </section>
  <div class="tb-small" style="padding-bottom: 8px" translate>device-profile.snmp.communication-configs</div>
  <tb-snmp-device-profile-communication-config formControlName="communicationConfigs">
  </tb-snmp-device-profile-communication-config>
</form>
