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 { FormControl, InputLabel, MenuItem, Select, withStyles } from '@material-ui/core';
import { Consent, ConsentActionType } from '@signatu/consent';
import React from 'react';
import Highlight from 'react-highlight';
import { DataProcessingSpec } from '../components/dataProcessingSpec';
import { DemoCard } from './common';
import { DataProcessingSpecSelector } from './dataProcessingSpecSelector';
var styles = function (theme) { return ({
    root: {
        display: 'flex',
        flexWrap: 'nowrap',
    },
    formControl: {
        margin: theme.spacing.unit,
        minWidth: 250,
        maxWidth: 500
    },
    selectEmpty: {
        marginTop: theme.spacing.unit * 2,
        minWidth: 200
    }
}); };
var DataProcessingSpecDemo = /** @class */ (function (_super) {
    __extends(DataProcessingSpecDemo, _super);
    function DataProcessingSpecDemo() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.state = {
            type: ConsentActionType.CHECKBOX
        };
        _this.name = "Data Processing Spec";
        _this.doc = (React.createElement(Highlight, { className: 'hljs' }, "\n\n"));
        return _this;
    }
    DataProcessingSpecDemo.prototype.render = function () {
        var _this = this;
        var _a = this.props, classes = _a.classes, config = _a.config;
        var demo = (React.createElement("div", null,
            React.createElement(DataProcessingSpecSelector, { config: config, onChange: function (event) { return _this.setState({ specId: event.target.value }); } }),
            React.createElement(FormControl, { className: classes.formControl },
                React.createElement(InputLabel, { htmlFor: "action-select" }, "Action Type"),
                React.createElement(Select, { inputProps: {
                        id: "action-select"
                    }, onChange: function (event) { return _this.setState({ type: event.target.value }); }, value: this.state.type },
                    React.createElement(MenuItem, { value: ConsentActionType.CHECKBOX }, "Checkbox"),
                    React.createElement(MenuItem, { value: ConsentActionType.BUTTONS }, "Buttons"))),
            React.createElement("hr", null),
            this.state.specId &&
                React.createElement(DataProcessingSpec, { config: this.props.config, subject: Consent.anonUserId(), issuer: "signatu.com", language: this.props.language, specId: this.state.specId, type: this.state.type })));
        return React.createElement(DemoCard, { element: demo, doc: this.doc });
    };
    return DataProcessingSpecDemo;
}(React.Component));
var styled = withStyles(styles)(DataProcessingSpecDemo);
export { styled as DataProcessingSpecDemo };
//# sourceMappingURL=dataProcessingSpecs.js.map