'use client'
import { useSelectedLayoutSegments } from '@/next/navigation'
import Script from '@/next/script'
import { GoogleAnalyticsTagScripts, GoogleConsentDefaults } from '../ga'
import { ConsoleAnalyticsRuntime } from './console-analytics-runtime'
import { WebAppAnalyticsRuntime } from './web-app-analytics-runtime'
const SHARE_LAYOUT_SEGMENT = '(shareLayout)'
type CloudAnalyticsLayoutBoundaryProps = {
cookieYesSiteKey: string
nonce?: string
}
export function CloudAnalyticsLayoutBoundary({
cookieYesSiteKey,
nonce,
}: CloudAnalyticsLayoutBoundaryProps) {
const layoutSegments = useSelectedLayoutSegments()
const cookieYesScript = (
)
if (layoutSegments.includes(SHARE_LAYOUT_SEGMENT)) {
return (
<>
{cookieYesScript}
>
)
}
return (
<>
{cookieYesScript}
>
)
}