import environmentLocal from './environment.local';
import environmentStaging from './environment.staging';
import type { Environment } from './evironment.interface';

export const environmentHelper = (environment: string | undefined): Environment => {
	if (environment === 'development' || environment === 'local' || !environment) {
		console.log('returning local', environmentLocal);
		return environmentLocal;
	}
	console.log('returning staging', environmentStaging);
	return environmentStaging;
};
// const env: string | undefined = process.env.NODE_ENV;
const env: string | undefined = process.env.REACT_APP_ENV;
console.log('environment file', env);
export default environmentHelper(env) as Environment;
