import moment from 'moment';
import 'react-native-get-random-values';
import { v4 as uuidv4 } from 'uuid';

// Function to generate UUID
export const generateUUID = () => {
  return uuidv4();
};
export const capitalize = (str = '') => {
  return str.charAt(0).toUpperCase() + str.slice(1);
};
export const dateConverstion = (date, dateType = 'YYYY-MM-DD', format = 'YYYY-MM-DD', addTime = false) => {
  if (addTime) {
    const currentTime = moment().format('hh:mm:ss');
    const customDate = `${date} ${currentTime}`;
    return moment(customDate, dateType).format(format);
  }
  return moment(date, dateType).format(format);
};
export const checkStringTypeOf = data => {
  if (typeof data === 'string') {
    return data;
  }
  return JSON.stringify(data);
};
export const getTherapyArea = userData => {
  var _userData$therapy_are;
  return (userData === null || userData === void 0 || (_userData$therapy_are = userData.therapy_area) === null || _userData$therapy_are === void 0 ? void 0 : _userData$therapy_are.toLowerCase()) || 'metabolism';
};
export const getDiseaseType = userData => {
  var _userData$disease;
  return (userData === null || userData === void 0 || (_userData$disease = userData.disease) === null || _userData$disease === void 0 ? void 0 : _userData$disease.toLowerCase()) || 'Diabetes';
};
//# sourceMappingURL=common.js.map