Files
solace-bg-dubai/frontend/components/web3/SignerStatus.tsx
T

12 lines
827 B
TypeScript

"use client";
import { useTreasuryAccess } from "@/lib/hooks/useTreasuryAccess";
export function SignerStatus({ action = "manage treasury funds" }: { action?: string }) {
const { chainId, isOwner, isLoading } = useTreasuryAccess();
if (chainId !== 138) return <div className="bg-yellow-900/30 border border-yellow-600 rounded-lg p-4 text-sm text-yellow-200">Switch MetaMask to Solace Chain 138 before you can {action}.</div>;
if (isLoading) return <div className="bg-gray-800 rounded-lg p-4 text-sm text-gray-400">Checking treasury signer permissions…</div>;
if (!isOwner) return <div className="bg-red-900/30 border border-red-600 rounded-lg p-4 text-sm text-red-200">This connected wallet is not a treasury signer. Ask an authorized signer to propose, approve, or execute this withdrawal.</div>;
return null;
}