import React from 'react';
import { Switch, Button } from 'antd';
import IconFont from '../../themeComponents/IconFont';
import CaptureTools from '../ToolsBar/CaptureTools';

function CaptureBar({ isOpenSelect, setSelectStatus, isDefaultRect, setIsDefaultRect, roiShow, setRoiShow, data, type, handleLink, showRoi = true, showIntelligent = true, ...res }) {
  return (
    <div className="capture-bar-layout">
      <CaptureTools
        {...data}
        {...res}
        type={type}
        handleLink={handleLink}
        rightExtContent={
          <Button onClick={() => setSelectStatus(!isOpenSelect)}>
            <IconFont type="icon-S_View_SearchBox" />
            {isOpenSelect ? '取消框选' : '框选搜图'}
          </Button>
        }
      />
      {
        <div className="rect-switch-box">

          {showIntelligent && <span className="rect-switch">
            <Switch className="" checked={!isDefaultRect} disabled={isOpenSelect} size="small" onChange={() => setIsDefaultRect(!isDefaultRect)} />
            <span>{isDefaultRect ? '智能识图' : '取消识图'}</span>
          </span>}
          {showRoi && <span className="rect-switch">
            <Switch className="" checked={roiShow} disabled={isOpenSelect} size="small" onChange={() => setRoiShow(!roiShow)} />
            <span>ROI区域</span>
          </span>}
        </div>
      }
    </div>
  );
}
export default CaptureBar;
