<!--

    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-marker-icon-shapes-panel">
  <div class="tb-marker-icon-shapes-title" translate>widgets.maps.data-layer.marker.marker-icon</div>
  <tb-material-icons [selectedIcon]="icon" [iconClearButton]="false" [showTitle]="false"
  [popover]="popover" (iconSelected)="selectIcon($event)"></tb-material-icons>
  <div class="tb-marker-icon-shapes-title" translate>widgets.maps.data-layer.marker.marker-appearance</div>
  <div class="flex flex-row flex-wrap gap-3">
    @for (containerInfo of iconContainers; track containerInfo) {
      @if (containerInfo.iconContainer === iconContainer) {
        <button class="tb-select-shape-button"
                mat-raised-button
                (click)="selectIconContainer(containerInfo.iconContainer)"
                type="button">
          <div class="tb-marker-shape" matButtonIcon [innerHTML]="containerInfo.html$ | async">
          </div>
        </button>
      } @else {
        <button class="tb-select-shape-button"
                mat-button
                (click)="selectIconContainer(containerInfo.iconContainer)"
                type="button">
          <div class="tb-marker-shape" matButtonIcon [innerHTML]="containerInfo.html$ | async">
          </div>
        </button>
      }
    }
  </div>
  <div class="tb-marker-icon-shapes-panel-buttons">
    <span class="flex-1"></span>
    <button mat-button
            color="primary"
            type="button"
            (click)="cancel()">
      {{ 'action.cancel' | translate }}
    </button>
    <button mat-raised-button
            color="primary"
            type="button"
            (click)="apply()"
            [disabled]="!dirty">
      {{ 'action.apply' | translate }}
    </button>
  </div>
</div>
