(null);
+ const { useTranslate } = useThemeHooks();
+ const { translate } = useTranslate();
+
+ const link = () => {props.name} amendment
+
+ React.useEffect(() => {
+ const fetchAmendments = async () => {
+ try {
+ setLoading(true);
+ const response = await fetch(`https://vhs.prod.ripplex.io/v1/network/amendments/vote/main/`);
+ if (!response.ok) {
+ throw new Error(`HTTP error! status: ${response.status}`);
+ }
+ const data: AmendmentsResponse = await response.json()
+ console.log("data.amendments is:", data.amendments)
+
+ let found_amendment = false
+ for (const amendment of data.amendments) {
+ if (amendment.name == props.name) {
+ setStatus(amendment)
+ found_amendment = true
+ break
+ }
+ }
+ if (!found_amendment) {
+ throw new Error(`Couldn't find ${props.name} amendment in status table.`)
+ }
+ } catch (err) {
+ setError(err instanceof Error ? err.message : 'Failed to fetch amendments');
+ } finally {
+ setLoading(false)
+ }
+ }
+ fetchAmendments()
+ }, [])
+
+ if (loading) {
+ return (
+
+ {translate("component.amendment-status.requires.1", "Requires the ")}{link()}{translate("component.amendment-status.requires.2", ".")}
+ {" "}
+
+ {translate("amendment.loading_status", "Loading...")}
+
+
+ )
+ }
+
+ if (error) {
+ return (
+
+ {translate("component.amendment-status.requires.1", "Requires the ")}{link()}{translate("component.amendment-status.requires.2", ".")}
+ {" "}
+
+ {translate("amendment.error_status", "Error loading amendment status")}: {error}
+
+
+ )
+ }
+
+ return (
+ (
+ {
+ amendmentStatus.date ? (
+ <>
+ {translate("component.amendment-status.added.1", "Added by the ")}{link()}
+ {translate("component.amendment-status.added.2", ".")}
+ {" "}
+
+ >
+ ) : (
+ <>
+ {translate("component.amendment-status.requires.1", "Requires the ")}{link()}
+ {translate("component.amendment-status.requires.2", ".")}
+ {" "}
+
+ >
+ )
+ }
+ )
+ )
+}
diff --git a/@theme/markdoc/schema.ts b/@theme/markdoc/schema.ts
index 6fd58b2fe9..d75840f85b 100644
--- a/@theme/markdoc/schema.ts
+++ b/@theme/markdoc/schema.ts
@@ -221,3 +221,15 @@ export const amendmentsTable: Schema & { tagName: string } = {
render: 'AmendmentsTable',
selfClosing: true
}
+
+export const amendmentDisclaimer: Schema & { tagName: string } = {
+ tagName: 'amendment-disclaimer',
+ attributes: {
+ name: {
+ type: 'String',
+ required: true
+ },
+ },
+ render: 'AmendmentDisclaimer',
+ selfClosing: true
+}