<!--
  ~ Licensed to the Apache Software Foundation (ASF) under one
  ~ or more contributor license agreements.  See the NOTICE file
  ~ distributed with this work for additional information
  ~ regarding copyright ownership.  The ASF licenses this file
  ~ to you 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.
-->

<app-help-message-show
  [help_message_content]="'alert.help.integration' | i18n"
  [guild_link]="'alert.help.integration.link' | i18n"
  [module_name]="'menu.alert.integration'"
  [icon_name]="'api'"
></app-help-message-show>

<nz-divider></nz-divider>

<div class="alert-integration-container">
  <div class="data-sources">
    <h2>{{ 'alert.integration.source' | i18n }}</h2>
    <div class="source-list">
      <div
        class="source-item"
        *ngFor="let source of dataSources"
        (click)="selectSource(source)"
        [class.active]="selectedSource?.id === source.id"
      >
        <img [src]="source.icon" [alt]="source.name" />
        <span>{{ source.name }}</span>
      </div>
    </div>
  </div>
  <div class="doc-content">
    <ng-container *ngIf="selectedSource">
      <div style="display: flex; justify-content: space-between; align-items: center">
        <h2>{{ selectedSource.name }}</h2>
        <button nz-button nzType="default" (click)="goToTokenManagement()" style="margin-right: 16px">
          <span nz-icon nzType="setting" nzTheme="outline"></span>
          {{ 'alert.integration.token.manage' | i18n }}
        </button>
      </div>
      <markdown [data]="markdownContent"></markdown>
    </ng-container>
  </div>
</div>
