import React from "react";
import { Icon, Menu, Input } from "antd";
import styles from "./index.css";

export default class TableColumnSetting extends React.Component {
  constructor(props) {
    super(props);
    this.defaultTableCode = "table"
  }

  setSortedInfo = (e, type) => {
    e.domEvent.stopPropagation();
    this.props.setSortData(type)
  };

  render() {

    return (
      <div className={styles.settingMenu}>
        <Menu mode="vertical" style={{ boxShadow: "0 2px 8px rgba(0, 0, 0, 0.15)"}}>
          <Menu.Item key="ascend" onClick={(e) => this.setSortedInfo(e, 0)}>
            <a target="_blank" rel="noopener noreferrer">
              <Icon type="sort-ascending" />
              正序
            </a>
          </Menu.Item>
          <Menu.Item key="descend" onClick={(e) => this.setSortedInfo(e, 1)}>
            <a target="_blank" rel="noopener noreferrer">
              <Icon type="sort-descending" />
              倒序
            </a>
          </Menu.Item>
          <Menu.Divider />
        </Menu>
      </div>
    )
  }
}