32 lines
791 B
TypeScript
32 lines
791 B
TypeScript
import { BRANDING_STORAGE_KEY, type BrokerageBrandingState } from '~/types/branding'
|
|
import { useLocalStorageRef } from '~/utils/useLocalStorageRef'
|
|
|
|
export function defaultBrokerageBranding(): BrokerageBrandingState {
|
|
return {
|
|
companyName: '',
|
|
logoDataUrl: null,
|
|
logoFileName: '',
|
|
reportPageHeader: '',
|
|
reportPageFooter: ''
|
|
}
|
|
}
|
|
|
|
export function useBrokerageBranding() {
|
|
const saved = useLocalStorageRef(BRANDING_STORAGE_KEY, defaultBrokerageBranding)
|
|
|
|
const productDisplayName = computed(() => {
|
|
const n = saved.value.companyName?.trim()
|
|
if (n) return n
|
|
return null
|
|
})
|
|
|
|
const sidebarTitle = computed(() => productDisplayName.value ?? 'Segur-OS')
|
|
|
|
return {
|
|
saved,
|
|
productDisplayName,
|
|
sidebarTitle,
|
|
defaultBrokerageBranding
|
|
}
|
|
}
|