import { Drawer as DrawerPrimitive } from "@base-ui/react/drawer"
import { createContext, useContext, useMemo, type ComponentProps } from "react"
import { cn } from "./utils.ts"
const DrawerContext = createContext({ showSwipeHandle: false })
export function Drawer({
showSwipeHandle = false,
swipeDirection = "down",
...props
}: DrawerPrimitive.Root.Props & { showSwipeHandle?: boolean }) {
const value = useMemo(() => ({ showSwipeHandle }), [showSwipeHandle])
return (
)
}
export function DrawerTrigger(props: DrawerPrimitive.Trigger.Props) {
return
}
export function DrawerContent({
className,
children,
...props
}: DrawerPrimitive.Popup.Props) {
const { showSwipeHandle } = useContext(DrawerContext)
return (
{showSwipeHandle && (
)}
{children}
)
}
export function DrawerHeader({ className, ...props }: ComponentProps<"div">) {
return (
)
}
export function DrawerTitle({
className,
...props
}: DrawerPrimitive.Title.Props) {
return (
)
}
export function DrawerDescription({
className,
...props
}: DrawerPrimitive.Description.Props) {
return (
)
}