import * as React from 'react';
import { Chrome } from './Chrome';
import { context } from './context';
import { ToolbarState } from './state';
export const RenderPeritext = ({ surface, opts, children }) => {
    const value = React.useMemo(() => ({ surface, toolbar: new ToolbarState(surface, opts) }), [surface, opts]);
    const toolbar = value.toolbar;
    React.useLayoutEffect(() => toolbar.start(), [toolbar]);
    return (React.createElement(context.Provider, { value: value },
        React.createElement(Chrome, null, children)));
};
//# sourceMappingURL=RenderPeritext.js.map