'use client' import * as React from 'react' import { cn } from '@admin/utils/shared/cn' import { Drawer as DrawerPrimitive } from '@base-ui/react/drawer' type DrawerContextProps = { container?: DrawerPrimitive.Portal.Props['container'] hasSnapPoints: boolean modal: DrawerPrimitive.Root.Props['modal'] showSwipeHandle: boolean swipeDirection: NonNullable } const DrawerContext = React.createContext(null) function useDrawer() { const context = React.useContext(DrawerContext) if (!context) { throw new Error('useDrawer must be used within a Drawer.') } return context } function Drawer({ container, modal = true, showSwipeHandle = false, snapPoints, swipeDirection = 'down', ...props }: DrawerPrimitive.Root.Props & { container?: DrawerPrimitive.Portal.Props['container'] showSwipeHandle?: boolean }) { const hasSnapPoints = snapPoints != null && snapPoints.length > 0 const contextValue = React.useMemo( () => ({ container, hasSnapPoints, modal, showSwipeHandle, swipeDirection }), [container, hasSnapPoints, modal, showSwipeHandle, swipeDirection] ) return ( ) } function DrawerTrigger({ ...props }: DrawerPrimitive.Trigger.Props) { return } function DrawerPortal({ ...props }: DrawerPrimitive.Portal.Props) { return } function DrawerClose({ ...props }: DrawerPrimitive.Close.Props) { return } function DrawerOverlay({ className, ...props }: DrawerPrimitive.Backdrop.Props) { return ( ) } function DrawerSwipeHandle({ className, ...props }: React.ComponentProps<'div'>) { return (