import { HostComponent, requireNativeComponent, Platform } from 'react-native';
import {} from 'react-native';

type OdpViewManagerProps = {};

let componentName = 'UnknownComponent';
if (Platform.OS == 'android') {
  componentName = 'OdpViewManager';
} else if (Platform.OS == 'ios') {
  componentName = 'JibeStreamOdp';
}

function getOdpViewManager(): HostComponent<OdpViewManagerProps> | null {
  try {
    return requireNativeComponent<OdpViewManagerProps>(componentName);
  } catch (e) {
    return null;
  }
}

export const OdpViewManager = getOdpViewManager();
