import React, { createContext, useContext } from 'react';

export type Environment = 'web' | 'print' | 'presentation';

const EnvironmentContext = createContext<Environment>('web');

export const EnvironmentProvider: React.FC<{ env: Environment; children: React.ReactNode }> = ({ env, children }) => {
  return (
    <EnvironmentContext.Provider value={env}>
      {children}
    </EnvironmentContext.Provider>
  );
};

export const useEnvironment = () => {
  return useContext(EnvironmentContext);
};
