pleroma/app/soapbox/features/account_timeline/containers/header_container.tsx

29 lines
671 B
TypeScript
Raw Normal View History

2022-08-11 09:57:09 -07:00
import React from 'react';
import { useAppSelector } from 'soapbox/hooks';
import { makeGetAccount } from 'soapbox/selectors';
import Header from '../components/header';
const getAccount = makeGetAccount();
interface IHeaderContainer {
accountId: string,
}
/**
* Legacy account Header container, accepting an accountId instead of an account.
* @deprecated Use account Header directly.
*/
const HeaderContainer: React.FC<IHeaderContainer> = ({ accountId }) => {
const account = useAppSelector(state => getAccount(state, accountId));
if (account) {
return <Header account={account} />;
} else {
return null;
}
};
export default HeaderContainer;