import React, { useEffect, useRef, useState } from "react";
import { Button, Divider, Upload, Row, Col, Form, Input } from "antd";
import { useNavigate } from "react-router-dom";
import { getTaMessage } from "@/service/taMessage";
import List from "@/components/Page/List";

export default (props) => {
  const ref = useRef();
  const navigate = useNavigate();

  const onDetail = (it) => {
    navigate(`/home/detail?id=${it.messageId}`);
  }

  const columns = [
    {
      title: "内容",
      dataIndex: "contentSent"
    }
  ]

  return (
    <List
      ref={ref}
      rowKey="rotationId"
      columns={columns}
      pagination={{ pageSize: 20 }}
      request={getTaMessage}
      columnOptionRender={(_, it) => [
        <Button style={{ paddingLeft: 0 }} type="link" onClick={() => onDetail(it)}>查看详情</Button>
      ]}
    />
  )
}