import React, { useState } from 'react'
import Checkbox from '../ui/Checkbox'

export default function RememberMeCheckbox({ initialChecked = false, label = 'Remember me', name = 'remember' }) {
  const [checked, setChecked] = useState(Boolean(initialChecked))

  return (
    <Checkbox
      name={name}
      value="1"
      checked={checked}
      onChange={(event) => setChecked(event.target.checked)}
      label={label}
      variant="accent"
      size={18}
    />
  )
}