<!--

    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">
    <a class="tb-title-link" href="https://thingsboard.io/docs/" target="_blank">{{ 'widgets.documentation.title' | translate }}</a>
    <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 docLink of documentationLinks?.links">
      <a fxFlex class="tb-link-button"
         [href]="docLink.link" target="_blank">
        <div class="tb-link-container">
          <div class="tb-link-icon-container">
            <tb-icon color="primary">{{ docLink.icon }}</tb-icon>
          </div>
          <div class="tb-link-text">{{ docLink.name }}</div>
        </div>
      </a>
    </mat-grid-tile>
    <mat-grid-tile class="tb-links-tile">
      <div fxFlex class="tb-add-link-button"
           matTooltip="{{ 'widgets.documentation.add-link' | translate }}"
           matTooltipPosition="above"
           (click)="addLink()">
        <tb-icon class="tb-add-icon">add</tb-icon>
      </div>
    </mat-grid-tile>
  </mat-grid-list>
</div>
