import { Tooltiper } from '@/components/ui/tooltip'; import { useAppParams } from '@/hooks/use-app-params'; import { useNumber } from '@/hooks/use-numer-formatter'; import { pushModal } from '@/modals'; import { cn } from '@/utils/cn'; import { getProfileName } from '@/utils/getters'; import { Link } from '@tanstack/react-router'; import type { IServiceEvent, IServiceEventMinimal } from '@openpanel/db'; import { SerieIcon } from '../report-chart/common/serie-icon'; import { EventIcon } from './event-icon'; type EventListItemProps = IServiceEventMinimal | IServiceEvent; export function EventListItem(props: EventListItemProps) { const { organizationId, projectId } = useAppParams(); const { createdAt, name, path, duration, meta } = props; const profile = 'profile' in props ? props.profile : null; const number = useNumber(); const renderName = () => { if (name === 'screen_view') { if (path.includes('/')) { return path; } return `Route: ${path}`; } return name.replace(/_/g, ' '); }; const renderDuration = () => { if (name === 'screen_view') { return ( {number.shortWithUnit(duration / 1000, 'min')} ); } return null; }; const isMinimal = 'minimal' in props; return ( <> ); }