:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
import clsx from 'clsx'
import { ReactNode } from 'react'
import { SpinnerOverlay } from '@posthog/lemon-ui'
export function SearchAndAiLoading({
loading,
label = 'Updating…',
className,
children,
}: {
loading: boolean
label?: string
className?: string
children?: ReactNode
}): JSX.Element {
return (
<div
className={clsx(
'SearchAndAiLoading relative isolate min-w-0 flex flex-col flex-1',
loading && 'SearchAndAiLoading--active',
className
)}
aria-busy={loading}
>
{children}
{loading && (
<div role="status" aria-label={label}>
<SpinnerOverlay />
<span className="sr-only">{label}</span>
</div>
)}
</div>
)
}