var __assign = (this && this.__assign) || function () {
    __assign = Object.assign || function(t) {
        for (var s, i = 1, n = arguments.length; i < n; i++) {
            s = arguments[i];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
                t[p] = s[p];
        }
        return t;
    };
    return __assign.apply(this, arguments);
};
import React, { useEffect } from 'react';
import { isFunction } from '../../lib/utils.js';
import { CommonWrapper } from '../../internal/CommonWrapper/index.js';
import { useResponsiveLayout } from './useResponsiveLayout.js';
/**
 * Компонент `ResponsiveLayout` для определения текущего лэйаута.
 */
export function ResponsiveLayout(props) {
    var _a, _b;
    var layoutFlags = useResponsiveLayout({ customMediaQueries: props.customMediaQueries });
    useEffect(function () {
        if (props.onLayoutChange) {
            props.onLayoutChange(layoutFlags);
        }
    }, [layoutFlags]);
    return (React.createElement(CommonWrapper, __assign({}, props), isFunction(props.children) ? (_a = props.children(layoutFlags)) !== null && _a !== void 0 ? _a : null : (_b = props.children) !== null && _b !== void 0 ? _b : null));
}
ResponsiveLayout.__KONTUR_REACT_UI__ = 'ResponsiveLayout';
ResponsiveLayout.displayName = 'ResponsiveLayout';
//# sourceMappingURL=ResponsiveLayout.js.map