import { Avatar } from 'flowbite-react' import { Entity, MegalodonInterface } from 'megalodon' import dayjs from 'dayjs' import Body from './Body' import Media from './Media' import emojify from '@/utils/emojify' import Card from './Card' import Poll from './Poll' import { FormattedMessage } from 'react-intl' import Actions from './Actions' type Props = { status: Entity.Status client: MegalodonInterface onRefresh: (status: Entity.Status) => void } export default function Status(props: Props) { const status = originalStatus(props.status) const onRefresh = async () => { const res = await props.client.getStatus(status.id) props.onRefresh(res.data) } return (
{rebloggedHeader(props.status)}
@{status.account.acct}
{status.poll && } {status.card && }
) } const originalStatus = (status: Entity.Status) => { if (status.reblog && !status.quote) { return status.reblog } else { return status } } const rebloggedHeader = (status: Entity.Status) => { if (status.reblog && !status.quote) { return (
) } else { return null } }