chore: More mixins migration to single use composables

This commit is contained in:
Fayaz Ahmed
2024-08-07 01:29:11 +05:30
parent 0bd62cf33f
commit 107852b4d9
6 changed files with 415 additions and 0 deletions
@@ -0,0 +1,13 @@
/**
* Composable for replacing 'Chatwoot' with a custom installation name in a string.
* @param {string} installationName - The custom installation name to replace 'Chatwoot' with.
* @returns {Function} A function that replaces 'Chatwoot' with the custom installation name in a given string.
*/
export function useInstallationName(installationName) {
return str => {
if (str && installationName) {
return str.replace(/Chatwoot/g, installationName);
}
return str;
};
}