import React from 'react';
import type { StyleProp, ViewStyle, ViewProps } from 'react-native';
import { StyledDivider } from './StyledDivider';

interface DividerProps extends ViewProps {
  /**
   * Horizontal margin size. There is no margin by default.
   */
  marginHorizontal?: 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge';
  /**
   * Vertical margin size. There is no margin by default.
   */
  marginVertical?: 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge';
  /**
   * Additional style.
   */
  style?: StyleProp<ViewStyle>;
  /**
   * Testing id of the component.
   */
  testID?: string;
}

const Divider = ({
  marginHorizontal,
  marginVertical,
  style,
  testID,
  ...nativeProps
}: DividerProps) => (
  <StyledDivider
    {...nativeProps}
    themeMarginHorizontal={marginHorizontal}
    themeMarginVertical={marginVertical}
    style={style}
    testID={testID}
  />
);

export default Divider;
