import React, { useEffect, useState } from 'react';
const RenderChildren = ({ children }) => children;
export const InteractiveWrapper = ({ wait, sideEffect, wrapper, children, }) => {
    const [testReady, setTestReady] = useState(false);
    useEffect(() => {
        if (wait) {
            setTimeout(() => setTestReady(true), wait);
        }
        else {
            setTestReady(true);
        }
    }, [wait]);
    useEffect(() => {
        if (sideEffect) {
            sideEffect();
        }
    }, [sideEffect]);
    const Wrapper = wrapper || RenderChildren;
    return (React.createElement("div", { "data-test-ready": testReady },
        React.createElement(Wrapper, null, children)));
};
//# sourceMappingURL=InteractiveWrapper.js.map