| 27 | } |
| 28 | |
| 29 | function ScrollBar({ |
| 30 | className, |
| 31 | orientation = "vertical", |
| 32 | ...props |
| 33 | }: React.ComponentProps<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>) { |
| 34 | return ( |
| 35 | <ScrollAreaPrimitive.ScrollAreaScrollbar |
| 36 | data-slot="scroll-area-scrollbar" |
| 37 | orientation={orientation} |
| 38 | className={cn( |
| 39 | "flex touch-none p-px transition-colors select-none", |
| 40 | orientation === "vertical" && "h-full w-2.5 border-l border-l-transparent", |
| 41 | orientation === "horizontal" && "h-2.5 flex-col border-t border-t-transparent", |
| 42 | className, |
| 43 | )} |
| 44 | {...props} |
| 45 | > |
| 46 | <ScrollAreaPrimitive.ScrollAreaThumb |
| 47 | data-slot="scroll-area-thumb" |
| 48 | className="relative flex-1 rounded-full bg-border" |
| 49 | /> |
| 50 | </ScrollAreaPrimitive.ScrollAreaScrollbar> |
| 51 | ); |
| 52 | } |
| 53 | |
| 54 | export { ScrollArea, ScrollBar }; |