Files
gochat/frontend/app/javascript/shared/composables/useBranding.js
T
Rogeeandrogee 867092fd99 HH-530: replace user-facing Chatwoot branding with GoChat (#117)
* 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>
2026-08-23 18:14:02 +08:00

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,
};
}