2026-06-01 23:35:00 +08:00
|
|
|
'use client'
|
2026-05-30 09:29:24 +08:00
|
|
|
|
2026-06-01 23:35:00 +08:00
|
|
|
import * as React from 'react'
|
|
|
|
|
import { Direction } from 'radix-ui'
|
2026-05-30 09:29:24 +08:00
|
|
|
|
|
|
|
|
function DirectionProvider({
|
|
|
|
|
dir,
|
|
|
|
|
direction,
|
|
|
|
|
children,
|
|
|
|
|
}: React.ComponentProps<typeof Direction.DirectionProvider> & {
|
2026-06-01 23:35:00 +08:00
|
|
|
direction?: React.ComponentProps<typeof Direction.DirectionProvider>['dir']
|
2026-05-30 09:29:24 +08:00
|
|
|
}) {
|
|
|
|
|
return (
|
2026-06-01 23:35:00 +08:00
|
|
|
<Direction.DirectionProvider dir={direction ?? dir}>{children}</Direction.DirectionProvider>
|
2026-05-30 09:29:24 +08:00
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const useDirection = Direction.useDirection
|
|
|
|
|
|
|
|
|
|
export { DirectionProvider, useDirection }
|