<!--

    Copyright © 2016-2023 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-card-content" fxLayout="column" fxLayoutGap="8px">
  <div class="tb-card-header">
    <div class="tb-title">{{ 'widgets.quick-links.title' | translate }}</div>
    <button class="tb-title-icon"
            matTooltip="{{ 'action.edit' | translate }}"
            matTooltipPosition="above"
            mat-icon-button
            (click)="edit()">
      <tb-icon>edit</tb-icon>
    </button>
  </div>
  <mat-grid-list class="tb-links-list" fxFlex [cols]="columns" [rowHeight]="rowHeight" [gutterSize]="gutterSize">
    <mat-grid-tile class="tb-links-tile" *ngFor="let quickLink of menuLinks$() | async">
      <a fxFlex class="tb-link-button"
         [routerLink]="quickLink.path">
        <div class="tb-link-container">
          <div class="tb-link-icon-container">
            <tb-icon color="primary">{{ quickLink.icon }}</tb-icon>
          </div>
          <div class="tb-link-text">{{ (quickLink.fullName || quickLink.name) | translate }}</div>
        </div>
      </a>
    </mat-grid-tile>
    <mat-grid-tile class="tb-links-tile">
      <div fxFlex class="tb-add-link-button"
           matTooltip="{{ 'widgets.quick-links.add-link' | translate }}"
           matTooltipPosition="above"
           (click)="addLink()">
        <tb-icon class="tb-add-icon">add</tb-icon>
      </div>
    </mat-grid-tile>
  </mat-grid-list>
</div>
