bigbuffet-rw/app/soapbox/features/status/containers/quoted_status_container.tsx
marcin mikolajczak 9822266561 do i really understand this?
Signed-off-by: marcin mikolajczak <git@mkljczk.pl>
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
Signed-off-by: marcin mikolajczak <git@mkljczk.pl>
2022-09-13 13:49:50 +02:00

28 lines
667 B
TypeScript

import React, { useCallback } from 'react';
import QuotedStatus from 'soapbox/components/quoted-status';
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(), []);
const status = useAppSelector(state => getStatus(state, { id: statusId }));
if (!status) {
return null;
}
return (
<QuotedStatus
status={status}
/>
);
};
export default QuotedStatusContainer;