tmagic-editor/playground/src/theme-loader.ts
2026-07-22 19:03:05 +08:00

9 lines
337 B
TypeScript

export const DEFAULT_THEME = 'magic-admin';
const themeLoaders: Record<string, () => Promise<unknown>> = {
default: () => import('@tmagic/editor/dist/style.css'),
'magic-admin': () => import('@tmagic/editor/dist/themes/magic-admin.css'),
};
export const loadTheme = (theme: string) => themeLoaders[theme]?.() ?? Promise.resolve();