You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
1.1 KiB

import React from 'react'
import PropTypes from 'prop-types'
import { FaCircle, FaCircleThin } from 'react-icons/lib/fa'
import styles from './Autopilot.scss'
const Autopilot = ({ autopilot, setAutopilot }) => (
<div className={styles.container}>
<section className={`${styles.enable} ${autopilot && styles.active}`}>
<div onClick={() => setAutopilot(true)}>
{
autopilot ?
<FaCircle />
:
<FaCircleThin />
}
<span className={styles.label}>
Enable Autopilot
</span>
</div>
</section>
<section className={`${styles.disable} ${(!autopilot && autopilot !== null) && styles.active}`}>
<div onClick={() => setAutopilot(false)}>
{
!autopilot && autopilot !== null ?
<FaCircle />
:
<FaCircleThin />
}
<span className={styles.label}>
Disable Autopilot
</span>
</div>
</section>
</div>
)
Autopilot.propTypes = {
autopilot: PropTypes.bool,
setAutopilot: PropTypes.func.isRequired
}
export default Autopilot