import React, { useMemo } from 'react' import { UniwindContext, useUniwindContext } from '../../core/context' import type { ThemeName, UniwindContextType } from '../../core/types' type ScopedThemeProps = { theme: ThemeName } export const ScopedTheme: React.FC> = ({ theme, children }) => { const uniwindContext = useUniwindContext() const value = useMemo( () => ({ ...uniwindContext, scopedTheme: theme }), [theme, uniwindContext], ) return ( {children} ) }