/*
 * Copyright (c) 2018-present, Revolut LTD.
 *
 * This source code is licensed under the Apache 2.0 license found in the
 * LICENSE file in the root directory of this source tree.
 */
import * as React from 'react'
import { StyledInputForCheckbox } from './styles'
type CheckboxInputProps = {
  id?: string
  checked?: boolean
  name?: string
  disabled?: boolean
  handleChange?: (...args: any[]) => any
}
export const CheckboxInput: React.SFC<CheckboxInputProps> = ({
  handleChange,
  id,
  ...rest
}) => {
  // @ts-ignore
  const { onChange, type, render, label, value, ...filteredRest } = rest // This is so ESLint doesn't complain
  return (
    <StyledInputForCheckbox
      {...filteredRest}
      value={value}
      type="checkbox"
      id={id}
      onChange={handleChange}
    />
  )
}
CheckboxInput.displayName = 'CheckboxInput'
