mirror of
https://github.com/hanzoai/insights-js.git
synced 2026-10-30 18:34:19 +00:00
Bulk rename across 989 files: - Package names: posthog-js → @hanzo/insights, posthog-node → @hanzo/insights-node, etc. - Repository URLs: posthog/posthog-js → hanzoai/insights-js - Brand names: PostHog → Insights - File renames: 259 reference JSON files, source files, workflow files - Directory rename: eslint-plugin-posthog-js → eslint-plugin-insights Remaining: 8 refs to @posthog/rrweb-* (real npm deps, need fork+publish)
46 lines
1.6 KiB
TypeScript
46 lines
1.6 KiB
TypeScript
import { CaptureResult } from '@hanzo/insights'
|
|
|
|
export function EventDisplay({ events }: { events: CaptureResult[] }) {
|
|
return (
|
|
<div
|
|
style={{
|
|
position: 'fixed',
|
|
bottom: 0,
|
|
right: 0,
|
|
width: '300px',
|
|
maxHeight: '100vh',
|
|
overflow: 'auto',
|
|
backgroundColor: '#f5f5f5',
|
|
border: '1px solid #ccc',
|
|
padding: '10px',
|
|
fontSize: '12px',
|
|
zIndex: 1000,
|
|
}}
|
|
>
|
|
<h3 style={{ margin: '0 0 10px 0' }}>Recent Events</h3>
|
|
{events.length === 0 ? (
|
|
<p>No events captured yet</p>
|
|
) : (
|
|
<ul style={{ listStyle: 'none', padding: 0, margin: 0 }}>
|
|
{events.map((event, index) => (
|
|
<li
|
|
key={index}
|
|
style={{
|
|
marginBottom: '10px',
|
|
padding: '8px',
|
|
backgroundColor: 'white',
|
|
borderRadius: '4px',
|
|
}}
|
|
>
|
|
<strong>{event.event}</strong>
|
|
<div style={{ marginTop: '4px', color: '#666', fontSize: '10px' }}>
|
|
{new Date(event.timestamp || Date.now()).toLocaleTimeString()}
|
|
</div>
|
|
</li>
|
|
))}
|
|
</ul>
|
|
)}
|
|
</div>
|
|
)
|
|
}
|