import { Alert, AlertIcon, Flex, AlertTitle, AlertDescription, } from "@chakra-ui/react"; import { Chain, getChainByChainId } from "@thirdweb-dev/chains"; import { Text } from "tw-components"; interface DeprecatedAlertProps { chain: Chain; description?: string; recommendedChainId?: number; } export const DeprecatedAlert: React.FC = ({ chain, description = "thirdweb services are not available on this network.", recommendedChainId, }) => { const recommendedChainName = recommendedChainId ? getChainByChainId(recommendedChainId).name : undefined; if (chain?.status !== "deprecated" || !chain?.name) { return null; } const cleanedChainName = chain?.name?.replace("Mainnet", "").trim(); return ( {cleanedChainName} is deprecated {description}{" "} {recommendedChainId && ( <> We recommend switching to {recommendedChainName}{" "} to continue testing your smart contracts. )} ); };