import { useAtom } from "jotai"; import { communityBotAtom, minimumTokenThresholdAtom } from "../../../atoms"; import { _t } from "../../../languageHandler"; import React from "react"; import { useVerifiedRoom } from "../../../hooks/useVerifiedRoom"; import { Room } from "matrix-js-sdk/src/matrix"; import { MessageButton } from "./MessageButton"; export function DisabledMessageField({ room }: { room: Room }): JSX.Element { const [allTokens] = useAtom(minimumTokenThresholdAtom) const [communityBot] = useAtom(communityBotAtom) const { isTokenGatedRoom, isCommunityRoom, } = useVerifiedRoom(room); let tokenThreshold = allTokens[room.name]; if(!tokenThreshold) { const tokenName = room.name.match(/\[TG] (.*) \(ct_.*\)/)?.[1]; if(isTokenGatedRoom && tokenName) { tokenThreshold = { threshold: "1", symbol: tokenName, } } } if (tokenThreshold) { return (