import React from 'react'; import { defineMessages, useIntl } from 'react-intl'; import { useAccount } from 'soapbox/api/hooks'; import AccountComponent from 'soapbox/components/account'; import Icon from 'soapbox/components/icon'; import { HStack } from 'soapbox/components/ui'; const messages = defineMessages({ birthday: { id: 'account.birthday', defaultMessage: 'Born {date}' }, }); interface IAccount { accountId: string } const Account: React.FC = ({ accountId }) => { const intl = useIntl(); const { account } = useAccount(accountId); if (!account) return null; const birthday = account.pleroma?.birthday; if (!birthday) return null; const formattedBirthday = intl.formatDate(birthday, { day: 'numeric', month: 'short', year: 'numeric' }); return (
{formattedBirthday}
); }; export default Account;