/*
 * Copyright © 2022 S20.AI India Pvt. Ltd.
 * Contact - origin@s20.ai
 * License - Licensed as per https://docs.s20.ai/license.html
 */
import React from "react";
import { Provider } from "react-redux";
import { store } from "./redux/store";
import { AppProps } from "./types/AppProps";
import Wrapper from "./Wrapper";
import { Slot } from "./types/Configuration";

export type SafecamCaptureRef = {
  addDynamic: (slots: Slot[]) => void;
};

const SafecamCapture: React.ForwardRefRenderFunction<
  SafecamCaptureRef,
  AppProps
> = (props, ref) => {
  return (
    <Provider store={store}>
      <Wrapper {...props} ref={ref} />
    </Provider>
  );
};

export default React.forwardRef(SafecamCapture);
