import React, { useMemo } from 'react' import { UniwindContext, useUniwindContext } from '../../core/context' import type { UniwindContextType } from '../../core/types' type LayoutDirectionProps = { rtl?: boolean } export const LayoutDirection: React.FC> = ({ rtl, children }) => { const uniwindContext = useUniwindContext() const value = useMemo( () => rtl === undefined ? uniwindContext : { ...uniwindContext, rtl }, [uniwindContext, rtl], ) const dir = rtl === undefined ? undefined : rtl ? 'rtl' : 'ltr' return (
{children}
) }