<commit_before>/**
 * mSupply Mobile
 * Sustainable Solutions (NZ) Ltd. 2020
 */

import { RootNavigator } from './RootNavigator';
import { goBack } from './actions';
import { ROUTES } from './constants';

import { navStrings } from '../localization';

export const SCREEN_TITLES = {
  [ROUTES.REALM_EXPLORER]: () => navStrings.realm_explorer,
  [ROUTES.CUSTOMER_REQUISITIONS]: () => navStrings.customer_requisitions,
  [ROUTES.SUPPLIER_REQUISITIONS]: () => navStrings.supplier_requisitions,
  [ROUTES.CUSTOMER_INVOICES]: () => navStrings.customer_invoices,
  [ROUTES.SUPPLIER_INVOICES]: () => navStrings.supplier_invoices,
  [ROUTES.STOCK]: () => navStrings.current_stock,
  [ROUTES.STOCKTAKES]: () => navStrings.stocktakes,
  [ROUTES.DISPENSARY]: () => navStrings.dispensary,
  [ROUTES.CASH_REGISTER]: () => navStrings.cash_register,
  [ROUTES.SETTINGS]: () => navStrings.settings,
  [ROUTES.DASHBOARD]: () => navStrings.dashboard,
  [ROUTES.MENU]: () => '',
  [ROUTES.CUSTOMER_REQUISITION]: ({ serialNumber } = {}) =>
    `${navStrings.requisition} ${serialNumber}`,
  [ROUTES.SUPPLIER_REQUISITION]: ({ serialNumber } = {}) =>
    `${navStrings.requisition} ${serialNumber}`,
  [ROUTES.CUSTOMER_INVOICE]: ({ isCredit, serialNumber } = {}) =>
    `${isCredit ? navStrings.credit : navStrings.invoice} ${serialNumber}`,
  [ROUTES.SUPPLIER_INVOICE]: ({ serialNumber } = {}) => `${navStrings.invoice} ${serialNumber}`,
  [ROUTES.STOCKTAKE_EDITOR]: ({ serialNumber } = {}) => `${navStrings.stocktake} ${serialNumber}`,
  [ROUTES.STOCKTAKE_MANAGER]: () => navStrings.manage_stocktake,
  [ROUTES.PRESCRIPTION]: ({ serialNumber } = {}) => `${navStrings.prescription} ${serialNumber}`,
};

export const getRouteTitle = (pageObject, routeName) => {
  if (!routeName) return '';<commit_msg>Update supplier credit back button title<commit_after>/**
 * mSupply Mobile
 * Sustainable Solutions (NZ) Ltd. 2020
 */

import { RootNavigator } from './RootNavigator';
import { goBack } from './actions';
import { ROUTES } from './constants';

import { navStrings } from '../localization';

export const SCREEN_TITLES = {
  [ROUTES.REALM_EXPLORER]: () => navStrings.realm_explorer,
  [ROUTES.CUSTOMER_REQUISITIONS]: () => navStrings.customer_requisitions,
  [ROUTES.SUPPLIER_REQUISITIONS]: () => navStrings.supplier_requisitions,
  [ROUTES.CUSTOMER_INVOICES]: () => navStrings.customer_invoices,
  [ROUTES.SUPPLIER_INVOICES]: () => navStrings.supplier_invoices,
  [ROUTES.STOCK]: () => navStrings.current_stock,
  [ROUTES.STOCKTAKES]: () => navStrings.stocktakes,
  [ROUTES.DISPENSARY]: () => navStrings.dispensary,
  [ROUTES.CASH_REGISTER]: () => navStrings.cash_register,
  [ROUTES.SETTINGS]: () => navStrings.settings,
  [ROUTES.DASHBOARD]: () => navStrings.dashboard,
  [ROUTES.MENU]: () => '',
  [ROUTES.CUSTOMER_REQUISITION]: ({ serialNumber } = {}) =>
    `${navStrings.requisition} ${serialNumber}`,
  [ROUTES.SUPPLIER_REQUISITION]: ({ serialNumber } = {}) =>
    `${navStrings.requisition} ${serialNumber}`,
  [ROUTES.CUSTOMER_INVOICE]: ({ isCredit, serialNumber } = {}) =>
    `${isCredit ? navStrings.credit : navStrings.invoice} ${serialNumber}`,
  [ROUTES.SUPPLIER_INVOICE]: ({ isCredit, serialNumber } = {}) =>
    `${isCredit ? navStrings.credit : navStrings.invoice} ${serialNumber}`,
  [ROUTES.STOCKTAKE_EDITOR]: ({ serialNumber } = {}) => `${navStrings.stocktake} ${serialNumber}`,
  [ROUTES.STOCKTAKE_MANAGER]: () => navStrings.manage_stocktake,
  [ROUTES.PRESCRIPTION]: ({ serialNumber } = {}) => `${navStrings.prescription} ${serialNumber}`,
};

export const getRouteTitle = (pageObject, routeName) => {
  if (!routeName) return '';
{'fraction_non_alphanumeric': 0.18371837183718373, 'fraction_numerical': 0.0022002200220022, 'mean_word_length': 5.494642857142857, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 43, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2200253', 'n_tokens_mistral': 1330, 'n_tokens_neox': 1324, 'n_words': 182}