mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
28 lines
689 B
React
28 lines
689 B
React
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 ? (
|
|
<span>{comment.cid.slice(2, 14)}</span>
|
|
) : (
|
|
comment.state === "pending" ? (
|
|
<span style={{color: 'red', fontWeight: '700'}}>
|
|
Pending
|
|
</span>
|
|
) : (
|
|
comment.state === "failed" ? (
|
|
<span style={{color: 'red', fontWeight: '700'}}>
|
|
Failed
|
|
</span>
|
|
) : null
|
|
)
|
|
)
|
|
);
|
|
};
|
|
|
|
export default PendingLabel; |