import { StyleSheet, Text, View, ViewProps, TouchableOpacity } from 'react-native'
import React from 'react'
import { SIZES } from '../../constants/theme';

interface RoundedButtonProps extends ViewProps{
  onPress?: ()=> void | undefined;
  color: string;
}

const RoundedButton: React.FC<RoundedButtonProps> = (props: RoundedButtonProps) => {
  const {onPress, color, style, ...restProps} = props;
  return (
    <TouchableOpacity onPress={onPress}>
      <View style={[{backgroundColor: color}, styles.btn, style]}{...restProps}>
        {restProps.children}
      </View>
    </TouchableOpacity>
  )
}

export default RoundedButton

const styles = StyleSheet.create({
  btn:{
    justifyContent: 'center',
    alignItems: 'center',
    borderRadius: 80
  },
  text: {
    fontSize: SIZES.normal
  }
})