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