import React, { useCallback } from 'react'; import { defineMessages, useIntl } from 'react-intl'; import { useDispatch } from 'react-redux'; import { Link } from 'react-router-dom'; import { authorizeFollowRequest, rejectFollowRequest } from 'soapbox/actions/accounts'; import Avatar from 'soapbox/components/avatar'; import DisplayName from 'soapbox/components/display-name'; import IconButton from 'soapbox/components/icon-button'; import { Text } from 'soapbox/components/ui'; import { useAppSelector } from 'soapbox/hooks'; import { makeGetAccount } from 'soapbox/selectors'; const messages = defineMessages({ authorize: { id: 'follow_request.authorize', defaultMessage: 'Authorize' }, reject: { id: 'follow_request.reject', defaultMessage: 'Reject' }, }); interface IAccountAuthorize { id: string, } const AccountAuthorize: React.FC = ({ id }) => { const intl = useIntl(); const dispatch = useDispatch(); const getAccount = useCallback(makeGetAccount(), []); const account = useAppSelector((state) => getAccount(state, id)); const onAuthorize = () => { dispatch(authorizeFollowRequest(id)); }; const onReject = () => { dispatch(rejectFollowRequest(id)); }; if (!account) return null; const content = { __html: account.note_emojified }; return (
); }; export default AccountAuthorize;