import React from "react";
import { useAccountComment } from "@plebbit/plebbit-react-hooks";
const PendingLabel = ({ commentIndex }) => {
const comment = useAccountComment({commentIndex: commentIndex});
if (commentIndex === undefined) return null;
return (
comment.cid ? (
{comment.cid.slice(2, 14)}
) : (
comment.state === "pending" ? (
Pending
) : (
comment.state === "failed" ? (
Failed
) : null
)
)
);
};
export default PendingLabel;