import React, { useState } from 'react';
import { useTranslation } from 'react-i18next';
import { CheckBoxWrap } from "./CheckBoxWrap";
import iconTick from "../../../styles/assets/icon/tick_black_thin.svg";
import { jsx as _jsx } from "react/jsx-runtime";
import { jsxs as _jsxs } from "react/jsx-runtime";
const CheckBox = ({
  label,
  defaultChecked,
  onClick
}) => {
  const {
    t
  } = useTranslation();
  const [checked, setChecked] = useState(defaultChecked);
  return /*#__PURE__*/_jsx(CheckBoxWrap, {
    children: /*#__PURE__*/_jsxs("div", {
      className: "checkBoxContainer",
      onClick: e => {
        onClick(e);
        setChecked(checked => !checked);
      },
      children: [/*#__PURE__*/_jsx("div", {
        className: "checkBox",
        children: checked && /*#__PURE__*/_jsx("img", {
          src: iconTick
        })
      }), /*#__PURE__*/_jsx("span", {
        className: "labelSpan",
        children: t(label)
      })]
    })
  });
};
export default CheckBox;