import { StyleSheet, Text, View, Switch as RNSwitch } from 'react-native'
import React from 'react'
import { SWIFT_BYTE_COLOURS } from '../../../constants'

interface SwitchProps {
    value: boolean
    onValueChange: (value: boolean) => void
    label?: string
}

export function Switch(props:SwitchProps) {
  return (
    <View style={
        {
            flexDirection: "row",
            alignItems: "center",
            justifyContent: "space-between",
            margin: 5
        }
    }>
      <RNSwitch {...props}
        trackColor={{ false: SWIFT_BYTE_COLOURS.GRAY, true: SWIFT_BYTE_COLOURS.YELLOW }}
      />
        {props.label && <Text
        style={{
            marginLeft: 10
        }}
    >{props.label}</Text>}
    </View>
  )
}

const styles = StyleSheet.create({})