import React, { useMemo, useContext, createContext, memo } from 'react'; import type { ThemeProviderProps, TokensType } from './interface'; import TOKENS from './tokens-mix'; const ThemeTokensContext = createContext(TOKENS); export const useThemeTokens = () => useContext(ThemeTokensContext); const ThemeProvider: React.FC = ({ children, theme }) => { const state = useMemo( () => ({ ...TOKENS, ...theme, }), [theme] ); return ( {children} ); }; export default memo(ThemeProvider);