import { motion } from 'motion/react'; import React, { forwardRef } from 'react'; import { useInternalContext } from './context'; import { useDragConstraints } from './hooks/use-drag-constraints'; import { SheetDragIndicator } from './sheet-drag-indicator'; import { styles } from './styles'; import { type SheetHeaderProps } from './types'; import { applyStyles, mergeRefs } from './utils'; export const SheetHeader = forwardRef( ( { children, style, disableDrag, unstyled, className = '', ...rest }, ref ) => { const sheetContext = useInternalContext(); const dragConstraints = useDragConstraints(); const dragProps = disableDrag || sheetContext.disableDrag ? undefined : sheetContext.dragProps; const isUnstyled = unstyled ?? sheetContext.unstyled; const headerWrapperStyle = { ...applyStyles(styles.headerWrapper, isUnstyled), ...style, }; const headerStyle = applyStyles(styles.header, isUnstyled); return ( {children || (
)}
); } ); SheetHeader.displayName = 'SheetHeader';