2022-12-16 02:50:11 +09:00
import { FormattedMessage } from 'react-intl' ;
2023-05-24 00:15:17 +09:00
import ImmutablePropTypes from 'react-immutable-proptypes' ;
2022-12-16 02:50:11 +09:00
import ImmutablePureComponent from 'react-immutable-pure-component' ;
2023-05-24 00:15:17 +09:00
2024-01-13 05:16:48 +09:00
import CheckIcon from 'mastodon/../material-icons/400-24px/check.svg?react' ;
import CloseIcon from 'mastodon/../material-icons/400-24px/close.svg?react' ;
2023-05-09 10:11:56 +09:00
import { Icon } from 'mastodon/components/icon' ;
2022-12-16 02:50:11 +09:00
export default class FollowRequestNote extends ImmutablePureComponent {
static propTypes = {
2023-11-04 00:00:03 +09:00
account : ImmutablePropTypes . record . isRequired ,
2022-12-16 02:50:11 +09:00
} ;
render ( ) {
const { account , onAuthorize , onReject } = this . props ;
return (
< div className = 'follow-request-banner' >
< div className = 'follow-request-banner__message' >
< FormattedMessage id = 'account.requested_follow' defaultMessage = '{name} has requested to follow you' values = { { name : < bdi > < strong dangerouslySetInnerHTML = { { _ _html : account . get ( 'display_name_html' ) } } / > < / bdi > } } / >
< / div >
< div className = 'follow-request-banner__action' >
< button type = 'button' className = 'button button-tertiary button--confirmation' onClick = { onAuthorize } >
2023-10-25 02:45:08 +09:00
< Icon id = 'check' icon = { CheckIcon } / >
2022-12-16 02:50:11 +09:00
< FormattedMessage id = 'follow_request.authorize' defaultMessage = 'Authorize' / >
< / button >
< button type = 'button' className = 'button button-tertiary button--destructive' onClick = { onReject } >
2023-10-25 02:45:08 +09:00
< Icon id = 'times' icon = { CloseIcon } / >
2022-12-16 02:50:11 +09:00
< FormattedMessage id = 'follow_request.reject' defaultMessage = 'Reject' / >
< / button >
< / div >
< / div >
) ;
}
}