mirror of
https://git.zhongyuan.online/ytke/tap.git
synced 2026-11-24 22:15:18 -08:00
22 lines
506 B
TypeScript
22 lines
506 B
TypeScript
"use client"
|
|||
|
|
|
||
|
|
import * as React from "react"
|
||
|
|
import { Direction } from "radix-ui"
|
||
|
|
|
||
|
|
function DirectionProvider({
|
||
|
|
dir,
|
||
|
|
direction,
|
||
|
|
children,
|
||
|
|
}: React.ComponentProps<typeof Direction.DirectionProvider> & {
|
||
|
|
direction?: React.ComponentProps<typeof Direction.DirectionProvider>["dir"]
|
||
|
|
}) {
|
||
|
|
return (
|
||
|
|
<Direction.DirectionProvider dir={direction ?? dir}>
|
||
|
|
{children}
|
||
|
|
</Direction.DirectionProvider>
|
||
|
|
)
|
||
|
|
}
|
||
|
|
|
||
|
|
const useDirection = Direction.useDirection
|
||
|
|
|
||
|
|
export { DirectionProvider, useDirection }
|