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-20 10:27:30 -08:00
|
|
|
return <Account account={account} hideActions showProfileHoverCard={false} />;
|
2022-04-10 03:46:25 -07:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
export default AutosuggestAccount;
|