2022-09-13 01:21:56 -07:00
|
|
|
import React, { useCallback } from 'react';
|
2022-04-10 03:46:25 -07:00
|
|
|
|
|
|
|
import Account from 'soapbox/components/account';
|
|
|
|
import { useAppSelector } from 'soapbox/hooks';
|
|
|
|
import { makeGetAccount } from 'soapbox/selectors';
|
|
|
|
|
|
|
|
interface IAutosuggestAccount {
|
|
|
|
id: string,
|
|
|
|
}
|
|
|
|
|
|
|
|
const AutosuggestAccount: React.FC<IAutosuggestAccount> = ({ id }) => {
|
2022-09-13 01:21:56 -07:00
|
|
|
const getAccount = useCallback(makeGetAccount(), []);
|
2022-04-10 03:46:25 -07:00
|
|
|
const account = useAppSelector((state) => getAccount(state, id));
|
|
|
|
|
|
|
|
if (!account) return null;
|
|
|
|
|
2022-11-19 18:15:32 -08:00
|
|
|
return (
|
|
|
|
<div className='relative'>
|
|
|
|
{/* HACK: The <Account> component stops click events, so insert this div as something to click. */}
|
|
|
|
<div className='absolute inset-0' />
|
|
|
|
|
|
|
|
<Account account={account} showProfileHoverCard={false} withLinkToProfile={false} hideActions />
|
|
|
|
</div>
|
|
|
|
);
|
2022-04-10 03:46:25 -07:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
export default AutosuggestAccount;
|