* fix(HH-530): replace user-facing Chatwoot branding * fix(HH-530): close branding review blockers * test(HH-530): cover update banner binding --------- Co-authored-by: Rogee <rogee@ipao.vip>
27 lines
791 B
JavaScript
27 lines
791 B
JavaScript
/**
|
|
* Composable for branding-related utilities
|
|
* Provides methods to customize text with installation-specific branding
|
|
*/
|
|
import { useMapGetter } from 'dashboard/composables/store.js';
|
|
|
|
export function useBranding() {
|
|
const globalConfig = useMapGetter('globalConfig/get');
|
|
/**
|
|
* Replaces the default product name in text with the configured installation name
|
|
* @param {string} text - The text to process
|
|
* @returns {string} - Text with the default product name replaced
|
|
*/
|
|
const replaceInstallationName = text => {
|
|
if (!text) return text;
|
|
|
|
const installationName = globalConfig.value?.installationName;
|
|
if (!installationName) return text;
|
|
|
|
return text.replace(/GoChat|Chatwoot/g, installationName);
|
|
};
|
|
|
|
return {
|
|
replaceInstallationName,
|
|
};
|
|
}
|