import PropTypes from 'prop-types';
import useMediaQuery from './useMediaQuery';
/**
 * Renders children only if the media query matches
 * @param {node} children What to render if the query is a match
 * @param {string} query A media query to check for conditionally rendering the children
 * @returns {node|null} The children if the query matches, otherwise, null
 */
var MediaQuery = function (_a) {
    var children = _a.children, query = _a.query;
    var matches = useMediaQuery(query);
    return matches ? children : null;
};
MediaQuery.propTypes = {
    children: PropTypes.node.isRequired,
    query: PropTypes.string.isRequired,
};
export default MediaQuery;
//# sourceMappingURL=MediaQuery.js.map