All checks were successful
CI / lint-and-test (push) Successful in 9m52s
Co-authored-by: Cursor <cursoragent@cursor.com>
34 lines
887 B
TypeScript
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}</>;
|
|
}
|