import { TriangleAlertIcon } from "lucide-react"; import { Alert, AlertDescription, AlertTitle } from "src/components/ui/alert"; import { useInfo } from "src/hooks/useInfo"; import { useMempoolApi } from "src/hooks/useMempoolApi"; import { ExternalLinkButton } from "./ui/custom/external-link-button"; export function MempoolAlert({ className }: { className?: string }) { const { data: info } = useInfo(); const { data: recommendedFees } = useMempoolApi<{ fastestFee: number }>( "/v1/fees/recommended", true ); const fees = { "EXTREMELY HIGH": 200, "very high": 150, high: 100, "moderately high": 50, }; const fee = recommendedFees?.fastestFee; const matchedFee = fee != null && Object.entries(fees).find((entry) => fee >= entry[1]); if (!info || !fee || !matchedFee) { return null; } return ( Mempool Fees are currently{" "} {matchedFee[0]}

Bitcoin transactions may be uneconomical at this time.

Learn more View fees on mempool
); }