import React from 'react';
import { AttachmentContextProvider } from '../components/shared/fileUpload/AttachmentReducerContext';
import { AppMetadataContextProvider } from './AppMetadataContext';
import { CreateCaseContextProvider } from './CreateCaseContext';
import { RecommendationContextProvider } from './RecommendationContext';
import { RouteContextProvider } from './RouteContext';
import { RulesContextProvider } from './RulesContext';

interface IProps {
    children: JSX.Element | JSX.Element[];
}
export default function RootContext(props: IProps) {
    return (
        <RouteContextProvider>
            <AppMetadataContextProvider>
                <CreateCaseContextProvider>
                    <RecommendationContextProvider>
                        <AttachmentContextProvider>
                            <RulesContextProvider>
                                {props.children}
                            </RulesContextProvider>
                        </AttachmentContextProvider>
                    </RecommendationContextProvider>
                </CreateCaseContextProvider>
            </AppMetadataContextProvider>
        </RouteContextProvider>
    );
}
