feat: track user interest in paid plans and enhance admin analytics

- Added tracking for user interest in the pro plan on the PricingPage.
- Implemented auto-retry for CSRF token failures in API response interceptor.
- Introduced new interfaces and API functions for enhanced admin analytics, including ratings, tool usage, user stats, plan interest, and system health.
This commit is contained in:
Your Name
2026-03-21 13:49:02 +02:00
parent c800f707e3
commit d8a51d8494
9 changed files with 2027 additions and 406 deletions

View File

@@ -37,6 +37,13 @@ export default function PricingPage() {
const [loading, setLoading] = useState(false);
async function handleUpgrade(billing: 'monthly' | 'yearly') {
// Track interest in paid plan
try {
await api.post('/internal/admin/plan-interest/record', { plan: 'pro', billing });
} catch {
// Non-critical — don't block the flow
}
if (!user) {
window.location.href = '/account?redirect=pricing';
return;