chore: added some buttons

This commit is contained in:
Paul Pan 2023-12-23 15:31:30 +08:00
parent 322917982e
commit ca50230731
2 changed files with 15 additions and 5 deletions

View File

@ -1,7 +1,7 @@
import { Link } from "react-router-dom"; import { Link } from "react-router-dom";
import { ProColumns, ProTable } from "@ant-design/pro-components"; import { ProColumns, ProTable } from "@ant-design/pro-components";
import { Button, Space } from "antd"; import { Button, Space, Tag } from "antd";
import { StatusApi } from "../api/status.ts"; import { StatusApi } from "../api/status.ts";
@ -35,6 +35,10 @@ const columns: ProColumns<SubmissionInfo>[] = [
title: "Point", title: "Point",
dataIndex: "point", dataIndex: "point",
align: "center", align: "center",
render: (_node, entity) => {
const color = entity.point === "Pending" ? "purple" : entity.point === "100" ? "green" : "red";
return <Tag color={color}>{entity.point}</Tag>;
},
}, },
{ {
title: "Date", title: "Date",

View File

@ -1,7 +1,7 @@
import { Link } from "react-router-dom"; import { Link } from "react-router-dom";
import { ProColumns, ProTable } from "@ant-design/pro-components"; import { ProColumns, ProTable } from "@ant-design/pro-components";
import { Button } from "antd"; import { Button, Space } from "antd";
import { ProblemApi } from "../api/problem.ts"; import { ProblemApi } from "../api/problem.ts";
@ -35,9 +35,15 @@ const columns: ProColumns<ProblemList>[] = [
dataIndex: "action", dataIndex: "action",
render: (_node, entity) => { render: (_node, entity) => {
return ( return (
<Button> <Space>
<Link to={`/problem/${entity.id}`}>View</Link> <Button>
</Button> <Link to={`/problem/${entity.id}`}></Link>
</Button>
<Button>
<Link to={`/problem/${entity.id}/status`}></Link>
</Button>
</Space>
); );
}, },
}, },