mirror of
https://github.com/siteboon/claudecodeui.git
synced 2026-03-12 09:27:22 +00:00
27 lines
752 B
TypeScript
27 lines
752 B
TypeScript
import * as React from 'react';
|
|
import { cn } from '../../../lib/utils';
|
|
|
|
type ScrollAreaProps = React.HTMLAttributes<HTMLDivElement>;
|
|
|
|
const ScrollArea = React.forwardRef<HTMLDivElement, ScrollAreaProps>(
|
|
({ className, children, ...props }, ref) => (
|
|
<div className={cn(className, 'relative overflow-hidden')} {...props}>
|
|
{/* Inner container keeps border radius while allowing momentum scrolling on touch devices. */}
|
|
<div
|
|
ref={ref}
|
|
className="h-full w-full rounded-[inherit] overflow-auto"
|
|
style={{
|
|
WebkitOverflowScrolling: 'touch',
|
|
touchAction: 'pan-y',
|
|
}}
|
|
>
|
|
{children}
|
|
</div>
|
|
</div>
|
|
)
|
|
);
|
|
|
|
ScrollArea.displayName = 'ScrollArea';
|
|
|
|
export { ScrollArea };
|