/*
* Copyright (c) 2021 Xilinx, Inc.
* 
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 
* associated documentation files (the "Software"), to deal in the Software without restriction, including 
* without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 
* copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to 
* the following conditions: 
* 
* The above copyright notice and this permission notice shall be included in all copies or substantial 
* portions of the Software. 
* 
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* 
*
*
*/
import { PolymerElement, html } from '@polymer/polymer/polymer-element.js';
import '@vaadin/vaadin-lumo-styles/icons.js';
import '@vaadin/vaadin-tabs/vaadin-tabs.js';
import './shared-styles.js';

class xregDBdata extends PolymerElement {
  static get template() {
    return html`
      <style include="shared-styles">
        :host {
          display: block;
        }
      </style>
      <div class="card">
      <vaadin-tabs selected="{{page}}">
        <vaadin-tab>
            <span>Versal ACAP</span>
        </vaadin-tab>
        <!-- <vaadin-tab>
            <span>PMC</span>
        </vaadin-tab> -->
        <!-- <vaadin-tab>
            <span>NPI</span>
        </vaadin-tab> -->
        <!-- <vaadin-tab>
            <span>DDR</span>
        </vaadin-tab> -->
        <!-- <vaadin-tab>
            <span>CPM</span>
        </vaadin-tab> -->
        <!-- <vaadin-tab>
            <span>AI Engine</span>
        </vaadin-tab> -->
        <!-- <vaadin-tab>
            <span>PL</span>
        </vaadin-tab> -->
        <vaadin-tab>
            <span>XSearch</span>
        </vaadin-tab>
      </vaadin-tabs>
      <iron-pages selected="[[page]]">
        <ps-module></ps-module>
        <!-- <pmc-module></pmc-module> -->
        <!-- <npi-module></npi-module> -->
        <!-- <ddr-module></ddr-module> -->
        <!-- <cpm-module></cpm-module> -->
        <!-- <me-data></me-data> -->
        <!-- <pl-module></pl-module> -->
        <xs-search></xs-search>
      </iron-pages>
      </div>
    `;
  }

  static get properties() {
    return {
      page: {
        type: String,
        reflectToAttribute: true,
        observer: '_pageChanged'
      }
    };
  }

  _pageChanged(page) {
    switch (page) {
      case 0:
        import('./templates/configuration/ps-module.js');
        break;
      // case 1:
      //   import('./templates/configuration/pmc-module.js');
      //   break;
      // case 2:
      //   import('./templates/configuration/npi-module.js');
      //   break;
      // case 2:
      //   import('./templates/configuration/ddr-module.js');
      //   break;
      // case 2:
      //   import('./templates/configuration/cpm-module.js');
      //   break;
      // case 5:
      //   import('./templates/configuration/me-module.js');
      //   break;
      // case 3:
      //   import('./templates/configuration/pl-data.js');
      //   break;
      case 1:
        import('./templates/configuration/xs-search.js');
        break;
    }
  }
}

window.customElements.define('xregv-data', xregDBdata);