import * as React from "react";
import { ScrollContainer, Scroll } from "./style";

export namespace Scroller {
    export interface Props {
        onScroll?: (e) => void;
        children: any;
    }
}

const Scroller: React.StatelessComponent<Scroller.Props> = (props: Scroller.Props): JSX.Element => (
    <ScrollContainer
        className="scroll-container"
        data-testid="container"
        onScroll={props.onScroll}
    >
        <Scroll className="scroll" data-testid="scroll">
            {props.children}
        </Scroll>
    </ScrollContainer>
);

export default Scroller;
