import { __assign, __rest } from "tslib";
import React, { useContext } from 'react';
import classNames from 'classnames';
import Popup from '../popup';
import { ConfigContext } from '../config-provider/config-context';
import { getPrefixCls } from '../_utils/general';
var Popover = function (props) {
    var _a = props.theme, theme = _a === void 0 ? 'light' : _a, _b = props.role, role = _b === void 0 ? 'tooltip' : _b, customisedCls = props.prefixCls, title = props.title, content = props.content, className = props.className, children = props.children, otherProps = __rest(props, ["theme", "role", "prefixCls", "title", "content", "className", "children"]);
    var configContext = useContext(ConfigContext);
    var prefixCls = getPrefixCls('popover', configContext.prefixCls, customisedCls);
    var cls = classNames(className, prefixCls, prefixCls + "_" + theme);
    var renderContent = function () { return (React.createElement("div", { role: role, className: prefixCls + "__inner" },
        title && React.createElement("div", { className: prefixCls + "__title" }, title),
        content && React.createElement("div", { className: prefixCls + "__content" }, content))); };
    return (React.createElement(Popup, __assign({}, otherProps, { className: cls, theme: theme, content: renderContent() }), children));
};
export default Popover;
//# sourceMappingURL=index.js.map