Playground.esm.js 916 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
import { createElement } from 'react';
import 'lodash/fp/get';
import { b as useComponents } from './chunk.esm.js';
import 'lodash/fp/omit';
import 'fast-deep-equal';
import 'lodash/fp/merge';
import 'array-sort';
import 'lodash/fp/unionBy';
import 'lodash/fp/flattenDepth';
import 'lodash/fp/pipe';
import 'ulid';
import 'match-sorter';
import 'lodash/fp/throttle';

const Playground = ({
  className,
  style,
  wrapper: Wrapper,
  children,
  __scope,
  __position,
  __code,
  __codesandbox
}) => {
  const components = useComponents();
  if (!components || !components.playground) return null;
  const props = {
    className,
    style,
    components
  };
  return createElement(components.playground, Object.assign({}, props, {
    component: children,
    wrapper: Wrapper,
    scope: __scope,
    position: __position,
    code: __code,
    codesandbox: __codesandbox
  }));
};

export default Playground;