'use client' import Link from 'next/link' import { formatNumber } from '@ciphera-net/ui' import { BookOpenIcon, ArrowRightIcon } from '@ciphera-net/ui' import type { GoalCountStat } from '@/lib/api/stats' interface GoalStatsProps { goalCounts: GoalCountStat[] onSelectEvent?: (eventName: string) => void } const LIMIT = 10 export default function GoalStats({ goalCounts, onSelectEvent }: GoalStatsProps) { const list = (goalCounts || []).slice(0, LIMIT) const hasData = list.length > 0 return (

Goals & Events

{hasData ? (
{list.map((row) => (
onSelectEvent?.(row.event_name)} className={`flex items-center justify-between py-2 px-3 rounded-lg bg-neutral-50 dark:bg-neutral-800/50 hover:bg-neutral-100 dark:hover:bg-neutral-800 transition-colors${onSelectEvent ? ' cursor-pointer' : ''}`} > {row.display_name ?? row.event_name.replace(/_/g, ' ')} {formatNumber(row.count)}
))}
) : (

Need help tracking goals?

Add pulse.track('event_name') where actions happen on your site, then see counts here. Check our guide for step-by-step instructions.

Read documentation
)}
) }