import React, {createContext} from 'react';
import {IContext, IProviderProps} from './types';

export const BasicModalContext = createContext<IContext>({
    onClose: () => {},
    open: false,
});

const BasicModalContextProvider: React.FC<IProviderProps> = ({
    children,
    onClose,
    open,
    ...rest
}) => {
    return (
        <BasicModalContext.Provider value={{onClose, open, ...rest}}>
            {children}
        </BasicModalContext.Provider>
    );
};

export default BasicModalContextProvider;
