// components/theme/themeManager.tsx import React, { useEffect } from 'react'; import { useThemeLoader } from './useThemeLoader'; interface ThemeManagerProps { themeName: string; children: React.ReactNode; } export const ThemeManager: React.FC = ({ themeName, children }) => { const { theme, loading, error } = useThemeLoader(themeName); if (loading) { return
加载主题中...
; } if (error) { return
主题加载失败: {error}
; } if (!theme) { return
主题未找到
; } return (
{children}
); };