This commit is contained in:
plebeius.eth
2023-09-16 21:40:23 +02:00
parent d963c90d26
commit 020e509b71
39 changed files with 1970 additions and 2035 deletions
+20 -25
View File
@@ -1,33 +1,28 @@
import React from "react";
import { useAccountComment } from "@plebbit/plebbit-react-hooks";
import useStateString from "../hooks/useStateString";
import React from 'react';
import { useAccountComment } from '@plebbit/plebbit-react-hooks';
import useStateString from '../hooks/useStateString';
const StateLabel = ({ commentIndex, className }) => {
const comment = useAccountComment({commentIndex: commentIndex});
const stateString = useStateString(comment);
const comment = useAccountComment({ commentIndex: commentIndex });
const stateString = useStateString(comment);
if (comment.updatedAt !== undefined || comment.index === undefined) {
return null;
}
if (comment.updatedAt !== undefined || comment.index === undefined) {
return null;
}
if (comment.state === "failed" || comment.state === "succeeded") {
return null;
}
if (comment.state === 'failed' || comment.state === 'succeeded') {
return null;
}
if (!stateString) {
return null;
}
if (!stateString) {
return null;
}
return (
<span className="ttl">
<br />
(
<span className={className}>
{stateString}
</span>
)
</span>
);
return (
<span className='ttl'>
<br />(<span className={className}>{stateString}</span>)
</span>
);
};
export default StateLabel;
export default StateLabel;