"use client" import * as React from "react" import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area" import { cn } from "../utils/cn" interface ScrollAreaProps extends React.ComponentPropsWithoutRef { /** * When set to true, the custom Radix scrollbars will be rendered. Defaults to `false` so that * scrollbars remain hidden in accordance with the global requirement to remove scrollbars. */ showScrollbar?: boolean } const ScrollArea = React.forwardRef< React.ElementRef, ScrollAreaProps >(({ className, children, showScrollbar = false, ...props }, ref) => ( {children} {showScrollbar && } {/* The corner element is only useful when scrollbars are visible */} {showScrollbar && } )) ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName const ScrollBar = React.forwardRef< React.ElementRef, React.ComponentPropsWithoutRef >(({ className, orientation = "vertical", ...props }, ref) => ( )) ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName export { ScrollArea, ScrollBar }