import React from 'react'; import Avatar from 'soapbox/components/avatar'; import DisplayName from 'soapbox/components/display_name'; import Permalink from 'soapbox/components/permalink'; import ActionButton from 'soapbox/features/ui/components/action_button'; import { useAppSelector } from 'soapbox/hooks'; import { makeGetAccount } from 'soapbox/selectors'; const getAccount = makeGetAccount(); const getFirstSentence = (str: string) => { const arr = str.split(/(([.?!]+\s)|[.。?!\n•])/); return arr[0]; }; interface IAccount { id: string, } const Account: React.FC = ({ id }) => { const account = useAppSelector((state) => getAccount(state, id)); if (!account) return null; return (
{getFirstSentence(account.get('note_plain'))}
); }; export default Account;