import { ConfigProvider, theme as antdTheme } from 'antd'; import type { ThemeProviderProps } from 'antd-style'; import { ThemeProvider } from 'antd-style'; import type { FC } from 'react'; import React, { useContext } from 'react'; const SiteThemeProvider: FC = ({ children, theme, ...rest }) => { const { getPrefixCls, iconPrefixCls } = useContext(ConfigProvider.ConfigContext); const rootPrefixCls = getPrefixCls(); const { token } = antdTheme.useToken(); React.useEffect(() => { ConfigProvider.config({ theme, }); }, [theme]); return ( {children} ); }; export default SiteThemeProvider;