import { forwardRef } from 'react';
import { View } from 'react-native';
import type { RsSkinlessDividerProps } from '../../types/props';

type ViewRef = View;

const RsDivider = forwardRef<ViewRef, RsSkinlessDividerProps>(
  ({ orientation = 'horizontal', style }, ref) => {
    return (
      <View
        ref={ref}
        style={[
          orientation === 'horizontal'
            ? { height: 1, width: '100%' }
            : { width: 1, height: '100%' },
          style,
        ]}
      />
    );
  }
);

RsDivider.displayName = 'RsDivider';

export default RsDivider;
