import React, { memo } from 'react';

export default memo(function LayerLock({ lock, onChange }: { lock: boolean; onChange: (param) => any }) {
  const handleClick = (e) => {
    e.stopPropagation();
    onChange(!lock);
  };

  return (
    <span onClick={handleClick} style={{ cursor: 'pointer' }}>
      {lock && <i className="icon iconfont icon-icon_lock" style={{ fontSize: 14 }} />}
    </span>
  );
});
