import { StyleSheet, Text, View } from 'react-native';
import { dividers } from './styles';
import type { IDividerProps } from './types';

export default function Divider(props: IDividerProps) {
  const { children, style } = props;
  return (
    <View style={StyleSheet.flatten([dividers.basic, style])}>
      <View style={dividers.line} />
      {children ? <Text style={dividers.text}>{children}</Text> : null}
    </View>
  );
}
