2022-04-11 12:58:48 -07:00
import React from 'react' ;
import { FormattedMessage } from 'react-intl' ;
import { NavLink } from 'react-router-dom' ;
2022-11-15 06:10:14 -08:00
import AvatarOverlay from 'soapbox/components/avatar-overlay' ;
2022-05-13 09:12:19 -07:00
import DisplayName from 'soapbox/components/display-name' ;
2022-04-11 12:58:48 -07:00
import Icon from 'soapbox/components/icon' ;
import type { Account as AccountEntity } from 'soapbox/types/entities' ;
interface IMovedNote {
from : AccountEntity ,
to : AccountEntity ,
}
const MovedNote : React.FC < IMovedNote > = ( { from , to } ) = > {
const displayNameHtml = { __html : from.display_name_html } ;
return (
< div className = 'account__moved-note' >
< div className = 'account__moved-note__message' >
< div className = 'account__moved-note__icon-wrapper' > < Icon src = { require ( 'feather-icons/dist/icons/briefcase.svg' ) } className = 'account__moved-note__icon' fixedWidth / > < / div >
< FormattedMessage id = 'account.moved_to' defaultMessage = '{name} has moved to:' values = { { name : < bdi > < strong dangerouslySetInnerHTML = { displayNameHtml } / > < / bdi > } } / >
< / div >
< NavLink to = { ` /@ ${ to . acct } ` } className = 'detailed-status__display-name' >
< div className = 'detailed-status__display-avatar' > < AvatarOverlay account = { to } friend = { from } / > < / div >
< DisplayName account = { to } / >
< / NavLink >
< / div >
) ;
} ;
export default MovedNote ;