Remove multi-tenant branches and default views, show logo-only boot and splash screens, and polish boursecu transactions tab styling. Co-authored-by: Cursor <cursoragent@cursor.com>
40 lines
1.2 KiB
TypeScript
40 lines
1.2 KiB
TypeScript
import { defineAsyncComponent, type Component } from 'vue'
|
|
import type { HomeLayoutConfig, HomeLayoutId } from './types'
|
|
import { boursecuHomeLayoutConfig } from './configs/boursecu'
|
|
|
|
export const DEFAULT_HOME_LAYOUT_ID: HomeLayoutId = 'boursecu'
|
|
|
|
const HOME_LAYOUT_CONFIGS: Record<HomeLayoutId, HomeLayoutConfig> = {
|
|
boursecu: boursecuHomeLayoutConfig,
|
|
}
|
|
|
|
let cachedLayoutRenderer: Component | null = null
|
|
|
|
function getLayoutRenderer(): Component {
|
|
if (!cachedLayoutRenderer) {
|
|
cachedLayoutRenderer = defineAsyncComponent(() => import('./HomeLayoutRenderer.vue'))
|
|
}
|
|
|
|
return cachedLayoutRenderer
|
|
}
|
|
|
|
export function isHomeLayoutId(value: unknown): value is HomeLayoutId {
|
|
return typeof value === 'string' && value in HOME_LAYOUT_CONFIGS
|
|
}
|
|
|
|
export function getHomeLayoutId(): HomeLayoutId {
|
|
return 'boursecu'
|
|
}
|
|
|
|
export function getHomeLayoutConfig(layoutId = getHomeLayoutId()): HomeLayoutConfig {
|
|
return HOME_LAYOUT_CONFIGS[layoutId] ?? boursecuHomeLayoutConfig
|
|
}
|
|
|
|
export function resolveHomeLayoutComponent(_layoutId = getHomeLayoutId()): Component {
|
|
return getLayoutRenderer()
|
|
}
|
|
|
|
export function registerHomeLayoutConfig(layoutId: HomeLayoutId, config: HomeLayoutConfig) {
|
|
HOME_LAYOUT_CONFIGS[layoutId] = config
|
|
}
|