import React from 'react'
import { TouchableOpacityProps } from 'react-native'

import { Container, Title } from './styles'

export type ButtonTypes = 'danger' | 'success' | 'gray'

interface ButtonProps extends TouchableOpacityProps {
  label: string
  type?: ButtonTypes
}

const Button = ({ label = '', type, ...rest }: ButtonProps) => {
  return (
    <Container {...rest} style={type}>
      <Title>{label}</Title>
    </Container>
  )
}

export default Button
