import React from 'react';
import styles from './Help.less';
import { isNodePage } from 'utils/utils';

function Help({ onShortcuts }: { onShortcuts: (x: boolean) => void }) {
  const isNodesPage = isNodePage();

  const handleLayerStick = () => {
    onShortcuts(true);
  };

  const routingHop = (router: string) => {
    window.open(window.appConfig.HOME_URL + router);
  };

  return (
    <ul className={styles.container}>
      <li
        className={styles.item}
        onClick={() => {
          routingHop('/help');
        }}>
        <span>帮助中心</span>
      </li>
      <li
        className={styles.item}
        onClick={() => {
          routingHop('/video-center');
        }}>
        <span>视频中心</span>
      </li>
      {!isNodesPage && (
        <li className={styles.item} onClick={handleLayerStick}>
          <span>快捷键</span>
        </li>
      )}
    </ul>
  );
}

export default Help;
