import { requireNativeComponent, UIManager } from "react-native";
import type { LuraPlayerNativeProps } from "../interfaces";
import { ErrorCode } from "../enums";

const COMPONENT_NAME = "LuraPlayerNative";

const LuraPlayerNative =
  UIManager.getViewManagerConfig(COMPONENT_NAME) != null
    ? requireNativeComponent<LuraPlayerNativeProps>(COMPONENT_NAME)
    : () => {
        throw new Error(ErrorCode.LINKING_ERROR);
      };

export default LuraPlayerNative;
