UNPKG

@skbkontur/ui-kit

Version:

27 lines 1.58 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var tslib_1 = require("tslib"); var react_1 = tslib_1.__importDefault(require("react")); var styled_components_1 = tslib_1.__importDefault(require("../../lib/styled-components")); var ClickableView = /** @class */ (function (_super) { tslib_1.__extends(ClickableView, _super); function ClickableView() { return _super !== null && _super.apply(this, arguments) || this; } ClickableView.prototype.render = function () { var _a = this.props, component = _a.component, clickableRef = _a.clickableRef, rest = tslib_1.__rest(_a, ["component", "clickableRef"]); var Component; if (component) { Component = component; } else { Component = rest.href ? "a" : "button"; } return react_1.default.createElement(Component, tslib_1.__assign({}, rest, { ref: clickableRef })); }; return ClickableView; }(react_1.default.Component)); var Clickable = styled_components_1.default(ClickableView)(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n background: none;\n border: none;\n padding: 0;\n margin: 0;\n border-radius: 0;\n text-decoration: none;\n cursor: pointer;\n font: inherit;\n color: inherit;\n"], ["\n background: none;\n border: none;\n padding: 0;\n margin: 0;\n border-radius: 0;\n text-decoration: none;\n cursor: pointer;\n font: inherit;\n color: inherit;\n"]))); exports.default = Clickable; var templateObject_1; //# sourceMappingURL=Clickable.js.map