import { __assign, __rest } from "tslib";
import React, { useContext } from 'react';
import classNames from 'classnames';
import { ConfigContext } from '../config-provider/config-context';
import { getPrefixCls } from '../_utils/general';
var AspectRatio = function (props) {
    var _a = props.ratio, ratio = _a === void 0 ? 1 : _a, _b = props.width, width = _b === void 0 ? '100%' : _b, customisedCls = props.prefixCls, className = props.className, style = props.style, children = props.children, otherProps = __rest(props, ["ratio", "width", "prefixCls", "className", "style", "children"]);
    var configContext = useContext(ConfigContext);
    var prefixCls = getPrefixCls('aspect-ratio', configContext.prefixCls, customisedCls);
    var cls = classNames(prefixCls, className);
    return (React.createElement("div", __assign({}, otherProps, { className: cls, style: __assign(__assign({}, style), { width: width }) }),
        React.createElement("div", { className: prefixCls + "__padding", style: { paddingTop: (1 / ratio) * 100 + "%" } }),
        React.createElement("div", { className: prefixCls + "__inside" }, children)));
};
export default AspectRatio;
//# sourceMappingURL=index.js.map