bigbuffet-rw/app/soapbox/features/status/containers/quoted-status-container.tsx

29 lines
667 B
TypeScript
Raw Normal View History

import React, { useCallback } from 'react';
2022-06-07 12:48:24 -07:00
2022-06-08 09:07:41 -07:00
import QuotedStatus from 'soapbox/components/quoted-status';
2022-06-07 12:48:24 -07:00
import { useAppSelector } from 'soapbox/hooks';
import { makeGetStatus } from 'soapbox/selectors';
interface IQuotedStatusContainer {
/** Status ID to the quoted status. */
statusId: string,
}
const QuotedStatusContainer: React.FC<IQuotedStatusContainer> = ({ statusId }) => {
const getStatus = useCallback(makeGetStatus(), []);
2022-06-07 12:48:24 -07:00
const status = useAppSelector(state => getStatus(state, { id: statusId }));
if (!status) {
return null;
}
return (
<QuotedStatus
status={status}
/>
);
};
export default QuotedStatusContainer;