Files
solace-bg-dubai/frontend/components/web3/ChainIndicator.tsx
defiQUG c94eb595f8
Some checks failed
CI / lint-and-test (push) Has been cancelled
Initial commit: add .gitignore and README
2026-02-09 21:51:53 -08:00

44 lines
932 B
TypeScript

"use client";
import { useChainId } from "wagmi";
export function ChainIndicator() {
const chainId = useChainId();
const getChainName = (id: number): string => {
switch (id) {
case 1:
return "Ethereum Mainnet";
case 11155111:
return "Sepolia Testnet";
case 138:
return "Solace Chain 138";
default:
return `Chain ${id}`;
}
};
const getChainColor = (id: number): string => {
switch (id) {
case 1:
return "text-blue-400";
case 11155111:
return "text-purple-400";
case 138:
return "text-green-400";
default:
return "text-gray-400";
}
};
return (
<div className="flex items-center gap-2">
<div className={`text-sm font-medium ${getChainColor(chainId)}`}>
{getChainName(chainId)}
</div>
<div className="text-xs text-gray-500">({chainId})</div>
</div>
);
}