import type { PropsWithChildren } from 'react';
import type { IOSInitialProps } from '../../initial-props';
import { InitialPropsContext } from '../../initial-props/context';
import { VisibilityProvider } from '../../visibility';

export function App({ children, ...initialProps }: PropsWithChildren<IOSInitialProps>) {
  return (
    <InitialPropsContext.Provider value={initialProps}>
      <VisibilityProvider isVisible={initialProps.isVisible}>{children}</VisibilityProvider>
    </InitialPropsContext.Provider>
  );
}
