feat: integrate analytics into main app
- Initialize analytics service on app startup - Add PostHogProvider wrapper for React integration - Include AnalyticsConsentBanner in App component - Set up app lifecycle tracking with useAppLifecycle hook - Configure PostHog with environment variables
This commit is contained in:
@@ -25,6 +25,8 @@ import { TabManager } from "@/components/TabManager";
|
||||
import { TabContent } from "@/components/TabContent";
|
||||
import { AgentsModal } from "@/components/AgentsModal";
|
||||
import { useTabState } from "@/hooks/useTabState";
|
||||
import { AnalyticsConsentBanner } from "@/components/AnalyticsConsent";
|
||||
import { useAppLifecycle } from "@/hooks";
|
||||
|
||||
type View =
|
||||
| "welcome"
|
||||
@@ -60,6 +62,9 @@ function AppContent() {
|
||||
const [projectForSettings, setProjectForSettings] = useState<Project | null>(null);
|
||||
const [previousView] = useState<View>("welcome");
|
||||
const [showAgentsModal, setShowAgentsModal] = useState(false);
|
||||
|
||||
// Initialize analytics lifecycle tracking
|
||||
useAppLifecycle();
|
||||
|
||||
// Load projects on mount when in projects view
|
||||
useEffect(() => {
|
||||
@@ -464,6 +469,9 @@ function AppContent() {
|
||||
onAgentsClick={() => setShowAgentsModal(true)}
|
||||
/>
|
||||
|
||||
{/* Analytics Consent Banner */}
|
||||
<AnalyticsConsentBanner />
|
||||
|
||||
{/* Main Content */}
|
||||
<div className="flex-1 overflow-hidden">
|
||||
{renderContent()}
|
||||
|
Reference in New Issue
Block a user