2016-08-17 12:06:38 +08:00
|
|
|
import React from 'react';
|
2019-08-13 14:07:17 +08:00
|
|
|
import { Tooltip } from 'antd';
|
2019-11-28 12:34:33 +08:00
|
|
|
import { EditOutlined } from '@ant-design/icons';
|
2016-08-17 12:06:38 +08:00
|
|
|
|
2017-02-16 10:18:41 +08:00
|
|
|
const branchUrl = 'https://github.com/ant-design/ant-design/edit/master/';
|
2016-08-17 18:33:19 +08:00
|
|
|
|
2016-08-17 12:06:38 +08:00
|
|
|
export default function EditButton({ title, filename }) {
|
|
|
|
return (
|
|
|
|
<Tooltip title={title}>
|
2018-12-07 16:17:45 +08:00
|
|
|
<a
|
|
|
|
className="edit-button"
|
|
|
|
href={`${branchUrl}${filename}`}
|
|
|
|
target="_blank"
|
|
|
|
rel="noopener noreferrer"
|
|
|
|
>
|
2019-11-28 12:34:33 +08:00
|
|
|
<EditOutlined />
|
2016-08-17 12:06:38 +08:00
|
|
|
</a>
|
|
|
|
</Tooltip>
|
|
|
|
);
|
|
|
|
}
|