Files
solace-bg-dubai/frontend/components/web3/WalletGate.tsx
T
2026-07-07 09:41:38 -07:00

34 lines
887 B
TypeScript

"use client";
import { useAccount } from "wagmi";
import { WalletConnect } from "@/components/web3/WalletConnect";
interface WalletGateProps {
title: string;
description?: string;
children: React.ReactNode;
}
export function WalletGate({ title, description, children }: WalletGateProps) {
const { isConnected } = useAccount();
if (!isConnected) {
return (
<div className="max-w-2xl mx-auto">
<div className="text-center py-12 sm:py-20">
<h2 className="text-2xl sm:text-3xl font-bold mb-3">{title}</h2>
<p className="text-gray-400 mb-8 max-w-md mx-auto">
{description ??
"Connect your Web3 wallet to access this treasury feature."}
</p>
<div className="flex justify-center">
<WalletConnect />
</div>
</div>
</div>
);
}
return <>{children}</>;
}