"use strict";
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
    if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
    return cooked;
};
Object.defineProperty(exports, "__esModule", { value: true });
var noop = require("lodash/noop");
var React = require("react");
var styled_components_1 = require("styled-components");
var DeleteButton_1 = require("../DeleteButton");
var Grid_1 = require("../Grid");
var ButtonWrapper = styled_components_1.default.button(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\tfont-size: 13px;\n\tmin-height: 22px;\n\tborder: 0;\n\tborder-radius: 3px;\n\tbackground-color: #e9e9e9;\n\tpadding: 3px 8px;\n"], ["\n\tfont-size: 13px;\n\tmin-height: 22px;\n\tborder: 0;\n\tborder-radius: 3px;\n\tbackground-color: #e9e9e9;\n\tpadding: 3px 8px;\n"])));
var WrappingEm = styled_components_1.default.em(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n\twhite-space: pre-wrap;\n"], ["\n\twhite-space: pre-wrap;\n"])));
var FilterDescriptionInner = function (props) { return (React.createElement(Grid_1.Box, null,
    !!props.filter.anyOf &&
        props.filter.anyOf.map(function (f, i) { return (React.createElement(React.Fragment, { key: i },
            i > 0 && React.createElement(WrappingEm, null, " or "),
            React.createElement("span", null, f.description))); }),
    !props.filter.anyOf && React.createElement("span", null, props.filter.description))); };
var FilterDescription = function (props) {
    return (React.createElement("div", null,
        React.createElement(ButtonWrapper, { onClick: !!props.edit ? props.edit : noop },
            React.createElement(Grid_1.Flex, null,
                React.createElement(FilterDescriptionInner, { filter: props.filter }))),
        !!props.delete && (React.createElement(DeleteButton_1.default, { color: props.dark ? '#fff' : undefined, onClick: props.delete }))));
};
exports.default = FilterDescription;
var templateObject_1, templateObject_2;
