import { useMemo } from 'react';
import { AcmsContext as AcmsContextType } from '@ablogcms/url/types';
import AcmsContext from './context';

interface AcmsContextProviderProps {
  context: AcmsContextType;
  children: React.ReactNode;
}

function AcmsContextProvider({ context, children }: AcmsContextProviderProps) {
  const value = useMemo(() => ({ context }), [context]);
  return <AcmsContext.Provider value={value}>{children}</AcmsContext.Provider>;
}

export default AcmsContextProvider;
