Skip to content

Instantly share code, notes, and snippets.

@buiducnhat
Last active May 17, 2024 15:54
Show Gist options
  • Save buiducnhat/ff41344768a74dd17fd8ededa2769af5 to your computer and use it in GitHub Desktop.
Save buiducnhat/ff41344768a74dd17fd8ededa2769af5 to your computer and use it in GitHub Desktop.
blog1
<Table
rowKey={(record) => record.id}
columns={[
{
title: 'ID',
dataIndex: 'id',
key: 'id',
},
{
title: 'Tên',
dataIndex: 'name',
key: 'name',
render: (text: string) => (
<Typography.Text strong>{text}</Typography.Text>
),
},
{
title: 'Phương thức',
dataIndex: 'method',
key: 'method',
render: (text) => <RequestMethodTag method={text} />,
},
{
title: 'URL',
key: 'url',
render: (_, record) => (
<Typography.Link>{`${record.protocol}://${record.host}:${record.port}${record.path}`}</Typography.Link>
),
},
{
title: 'Hành động',
key: 'actions',
render: (_, record) => (
<Flex>
<Button
icon={<EditOutlined />}
type="link"
onClick={() => {
setRequestById(record.id);
}}
>
Sửa
</Button>
<Button danger type="link" icon={<DeleteOutlined />}>
Xóa
</Button>
</Flex>
),
},
]}
dataSource={project.requests}
pagination={false}
/>;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment