import React, { forwardRef, PropsWithChildren } from 'react';

interface DividerProps extends PropsWithChildren<any> {
    orientation?: 'vertical' | 'horizontal';
    variant?: 'full-width' | 'inset' | 'middle-inset';
}

const Divider = forwardRef<HTMLHRElement, DividerProps>(
    ({ orientation, variant, ...props }, ref) => (
        <hr
            {...props}
            className={`m3 m3-divider ${orientation ?? 'horizontal'} ${variant ?? 'full-width'}`.trimEnd()}
            ref={ref}
        />
    ),
);

export { Divider };
