import React, { useState, useCallback } from "react";
import { Table } from "antd";
import { useData, useActions, useCommit } from "@ttk/app-loader";

export default function TableCom(props) {
  const commit = useCommit();
  const actions = useActions(props);
  const conditionData = useData([props, "conditionData"]).toJS();
  const columns = [
    {
      title: "月份",
      dataIndex: "date",
      key: "date",
    },
    {
      title: "收入",
      dataIndex: "income",
      key: "income",
    },
    {
      title: "支出",
      dataIndex: "expend",
      key: "expend",
    },
    {
      title: "利润",
      dataIndex: "profit",
      key: "profit",
    },
  ];
  return (
    <Table
      dataSource={conditionData}
      columns={columns}
      pagination={false}
      bordered={true}
    />
  );
}
