const React = require('react');

function codegenNativeComponent(componentName, options) {
  const componentNameClean = componentName
    .replace(/^RNC/, '')
    .replace(/^RNS/, '')
    .replace(/^RN/, '');

  const NativeComponent = React.forwardRef((props, ref) => {
    const { children, ...rest } = props;
    return React.createElement('div', { ...rest, ref, 'data-native-component': componentNameClean }, children);
  });
  NativeComponent.displayName = componentName;

  return NativeComponent;
}

module.exports = codegenNativeComponent;