import { NavigateToSignUp, useSession } from "@wacht/react-router";
// E.g. A user organically navigates to a promotional landing page URL
// for a free tool that actually requires an account to function.
export default function FreeToolGate() {
const { loading, session } = useSession();
if (loading) return null;
// If they aren't logged in, redirect them immediately to register.
// We use the component instead of imperative router hooks to ensure
// the transition happens deterministically during the render phase.
if (!session) {
return <NavigateToSignUp />;
}
return (
<div>
<h1>Advanced Metric Analyzer</h1>
{/* Tool UI... */}
</div>
);
}