diff --git a/components/journeys/TopPathsTable.tsx b/components/journeys/TopPathsTable.tsx index f85e57c..72bdcd1 100644 --- a/components/journeys/TopPathsTable.tsx +++ b/components/journeys/TopPathsTable.tsx @@ -2,7 +2,7 @@ import type { TopPath } from '@/lib/api/journeys' import { TableSkeleton } from '@/components/skeletons' -import { Path, ArrowRight, Clock, Users } from '@phosphor-icons/react' +import { Path, ArrowRight, Clock } from '@phosphor-icons/react' interface TopPathsTableProps { paths: TopPath[] @@ -24,8 +24,16 @@ function smartLabel(path: string): string { return `…/${segments[segments.length - 1]}` } +function truncateSequence(seq: string[], max: number): (string | null)[] { + if (seq.length <= max) return seq + const head = seq.slice(0, 3) + const tail = seq.slice(-2) + return [...head, null, ...tail] +} + export default function TopPathsTable({ paths, loading }: TopPathsTableProps) { const hasData = paths.length > 0 + const maxCount = hasData ? paths[0].session_count : 0 return (