var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
import 'highlight.js/styles/github.css';
import { Tab, Tabs } from '@material-ui/core';
import { Consent } from '@signatu/consent';
import React from 'react';
import { ButtonDemo } from './demo/button';
import { CheckboxDemo } from './demo/checkbox';
import { CondTrackerPopupDemo } from './demo/condTrackerPopup';
import { CookieBannerDemo } from './demo/cookieBanner';
import { DataProcessingDemo } from './demo/dataProcessing';
import { DataProcessingGroupDemo } from './demo/dataProcessingGroup';
import { DataProcessingSpecDemo } from './demo/dataProcessingSpecs';
import { PolicyDashboardDemo } from './demo/policyDashboard';
import TrackersDemo from './demo/trackers';
var examples = [
    { name: "Buttons", component: ButtonDemo },
    { name: "Checkbox", component: CheckboxDemo },
    { name: "Processing", component: DataProcessingDemo },
    { name: "Specs", component: DataProcessingSpecDemo },
    { name: "Group", component: DataProcessingGroupDemo },
    { name: "Dashboard", component: PolicyDashboardDemo },
    { name: "Cookie", component: CookieBannerDemo },
    { name: "Tracker", component: TrackersDemo },
    { name: "Conditional", component: CondTrackerPopupDemo }
];
var Demo = /** @class */ (function (_super) {
    __extends(Demo, _super);
    function Demo(props) {
        var _this = _super.call(this, props) || this;
        _this.state = {
            showPopup: false,
            subjectId: Consent.anonSubject(),
            trackers: [],
            selectedTab: 0
        };
        return _this;
    }
    Demo.prototype.render = function () {
        var _this = this;
        var _a = this.props, config = _a.config, language = _a.language, subject = _a.subject;
        var tabs = examples.map(function (e, idx) { return React.createElement(Tab, { label: e.name, key: idx }); });
        var selectedComponent = examples[this.state.selectedTab];
        var selectedTab = React.createElement(selectedComponent.component, { config: config, subject: subject, language: language });
        return React.createElement("div", null,
            React.createElement(Tabs, { scrollable: true, scrollButtons: "auto", value: this.state.selectedTab, onChange: function (event, value) { return _this.setState({ selectedTab: value }); } }, tabs),
            selectedTab);
    };
    return Demo;
}(React.Component));
export { Demo };
//# sourceMappingURL=demo.js.map