import { Modules } from 'src/types/amplitude';
import { FormStatus } from 'src/types/forms';

export const getModule = location => {
  const module = location?.pathname?.split('/') || [];
  return Modules[module[1]?.toUpperCase()];
};

export const getStatusFormForAmplitude = (approveForm, rejectForm) => {
  if (approveForm) return FormStatus.APPROVED.toLowerCase();
  if (rejectForm) return FormStatus.REJECTED.toLowerCase();
  return null;
};
