<!--

    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.

-->
<section [formGroup]="processingSettingRowForm" class="tb-form-panel stroked no-gap no-padding-bottom">
  <div class="tb-form-panel-title mb-4">{{ title }}</div>
  <mat-form-field [appearance]="appearance">
    <mat-label translate>rule-node-config.save-time-series.strategy</mat-label>
    <mat-select formControlName="type">
      @for (strategy of processingStrategies; track strategy) {
        <mat-option [value]="strategy">{{ ProcessingTypeTranslationMap.get(strategy) | translate }}</mat-option>
      }
    </mat-select>
  </mat-form-field>
  @if (processingSettingRowForm.get('type').value === ProcessingType.DEDUPLICATE) {
    <tb-time-unit-input
      required
      labelText="{{ 'rule-node-config.save-time-series.deduplication-interval' | translate }}"
      requiredText="{{ 'rule-node-config.save-time-series.deduplication-interval-required' | translate }}"
      minErrorText="{{ 'rule-node-config.save-time-series.deduplication-interval-min-max-range' | translate }}"
      maxErrorText="{{ 'rule-node-config.save-time-series.deduplication-interval-min-max-range' | translate }}"
      [minTime]="1"
      [maxTime]="maxDeduplicateTime"
      [appearance]="appearance"
      formControlName="deduplicationIntervalSecs">
    </tb-time-unit-input>
  }
</section>
