26 lines
1009 B
TypeScript
26 lines
1009 B
TypeScript
import type { WelcomeDashboardConfig } from '~/types/welcome-dashboard'
|
|
|
|
/**
|
|
* Home / welcome dashboard content. Reads `app.config` first; later merge runtime config or APIs.
|
|
* Brokerage company name from Settings → Personalization overrides `productName` when set.
|
|
*/
|
|
export function useWelcomeDashboard(): ComputedRef<WelcomeDashboardConfig> {
|
|
const app = useAppConfig()
|
|
const { saved: branding } = useBrokerageBranding()
|
|
|
|
return computed((): WelcomeDashboardConfig => {
|
|
const base = (app.welcomeDashboard ?? {}) as Partial<WelcomeDashboardConfig>
|
|
const fromBranding = branding.value.companyName?.trim()
|
|
return {
|
|
greetingName: base.greetingName ?? 'User',
|
|
productName: fromBranding || base.productName || 'Segur-OS Beta',
|
|
subtitle: base.subtitle ?? '',
|
|
dailyTasks: base.dailyTasks ?? [],
|
|
alerts: base.alerts ?? [],
|
|
performanceKpis: base.performanceKpis ?? [],
|
|
ceoKpis: base.ceoKpis ?? [],
|
|
quickLinks: base.quickLinks ?? []
|
|
}
|
|
})
|
|
}
|