refactor: GrantPermissionButton

This commit is contained in:
scarf 2025-03-27 01:51:13 +09:00
parent 85e89dfc16
commit a97ee55650
No known key found for this signature in database
GPG Key ID: 07CA0A3CCA037E7D
2 changed files with 23 additions and 20 deletions

View File

@ -1,20 +0,0 @@
import PropTypes from 'prop-types';
import { PureComponent } from 'react';
import { FormattedMessage } from 'react-intl';
export default class GrantPermissionButton extends PureComponent {
static propTypes = {
onClick: PropTypes.func.isRequired,
};
render () {
return (
<button className='text-btn column-header__permission-btn' tabIndex={0} onClick={this.props.onClick}>
<FormattedMessage id='notifications.grant_permission' defaultMessage='Grant permission.' />
</button>
);
}
}

View File

@ -0,0 +1,23 @@
import { MouseEventHandler } from 'react';
import { FormattedMessage } from 'react-intl';
interface Props {
onClick: MouseEventHandler<HTMLButtonElement>;
}
const GrantPermissionButton: React.FC<Props> = ({ onClick }) => {
return (
<button
className='text-btn column-header__permission-btn'
tabIndex={0}
onClick={onClick}
>
<FormattedMessage
id='notifications.grant_permission'
defaultMessage='Grant permission.'
/>
</button>
);
};
export default GrantPermissionButton;