You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
591 B
26 lines
591 B
8 years ago
|
import React from 'react';
|
||
5 years ago
|
import { Tooltip } from 'antd';
|
||
5 years ago
|
import { EditOutlined } from '@ant-design/icons';
|
||
8 years ago
|
|
||
8 years ago
|
const branchUrl = 'https://github.com/ant-design/ant-design/edit/master/';
|
||
8 years ago
|
|
||
5 years ago
|
export interface EditButtonProps {
|
||
|
title: React.ReactNode;
|
||
|
filename?: string;
|
||
|
}
|
||
|
|
||
|
export default function EditButton({ title, filename }: EditButtonProps) {
|
||
8 years ago
|
return (
|
||
|
<Tooltip title={title}>
|
||
6 years ago
|
<a
|
||
|
className="edit-button"
|
||
|
href={`${branchUrl}${filename}`}
|
||
|
target="_blank"
|
||
|
rel="noopener noreferrer"
|
||
|
>
|
||
5 years ago
|
<EditOutlined />
|
||
8 years ago
|
</a>
|
||
|
</Tooltip>
|
||
|
);
|
||
|
}
|