29 lines
602 B
TypeScript
29 lines
602 B
TypeScript
import { forwardRef, type HTMLAttributes, type ReactNode } from "react";
|
|
|
|
export type PageScrollViewportProps = Omit<
|
|
HTMLAttributes<HTMLDivElement>,
|
|
"children"
|
|
> & {
|
|
children: ReactNode;
|
|
};
|
|
|
|
const PageScrollViewport = forwardRef<HTMLDivElement, PageScrollViewportProps>(
|
|
function PageScrollViewport({
|
|
children,
|
|
className = "",
|
|
...props
|
|
}, ref) {
|
|
return (
|
|
<div
|
|
{...props}
|
|
ref={ref}
|
|
className={["page-scroll-viewport", className].filter(Boolean).join(" ")}
|
|
>
|
|
{children}
|
|
</div>
|
|
);
|
|
}
|
|
);
|
|
|
|
export default PageScrollViewport;
|