pleroma/app/soapbox/features/compose/components/autosuggest_account.js

21 lines
551 B
JavaScript
Raw Normal View History

2022-03-21 11:09:01 -07:00
import PropTypes from 'prop-types';
2020-03-27 13:59:38 -07:00
import React from 'react';
2022-03-21 11:09:01 -07:00
import { useSelector } from 'react-redux';
2022-03-21 11:09:01 -07:00
import Account from '../../../components/account';
import { makeGetAccount } from '../../../selectors';
2020-03-27 13:59:38 -07:00
2022-03-21 11:09:01 -07:00
const AutosuggestAccount = ({ id }) => {
const getAccount = makeGetAccount();
const account = useSelector((state) => getAccount(state, id));
2020-03-27 13:59:38 -07:00
2022-03-21 11:09:01 -07:00
return <Account account={account} hideActions showProfileHoverCard={false} />;
2020-03-27 13:59:38 -07:00
2022-03-21 11:09:01 -07:00
};
2020-03-27 13:59:38 -07:00
2022-03-21 11:09:01 -07:00
AutosuggestAccount.propTypes = {
id: PropTypes.number.isRequired,
};
2020-03-27 13:59:38 -07:00
2022-03-21 11:09:01 -07:00
export default AutosuggestAccount;