diff --git a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/profiles/[profileId]/page.tsx b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/profiles/[profileId]/page.tsx index 098e4b99..a58400e1 100644 --- a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/profiles/[profileId]/page.tsx +++ b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/profiles/[profileId]/page.tsx @@ -1,31 +1,25 @@ -import { Suspense } from 'react'; +import { start } from 'repl'; import PageLayout from '@/app/(app)/[organizationSlug]/[projectId]/page-layout'; import ClickToCopy from '@/components/click-to-copy'; import { ListPropertiesIcon } from '@/components/events/list-properties-icon'; import { ProfileAvatar } from '@/components/profiles/profile-avatar'; -import { ChartSwitch } from '@/components/report/chart'; -import { Tooltiper } from '@/components/ui/tooltip'; -import { Widget, WidgetBody, WidgetHead } from '@/components/widget'; import { eventQueryFiltersParser, eventQueryNamesFilter, } from '@/hooks/useEventQueryFilters'; -import { clipboard } from '@/utils/clipboard'; import { getProfileName } from '@/utils/getters'; -import { CopyIcon } from 'lucide-react'; import { notFound } from 'next/navigation'; -import { parseAsInteger, parseAsString } from 'nuqs'; -import { toast } from 'sonner'; +import { parseAsInteger } from 'nuqs'; import type { GetEventListOptions } from '@openpanel/db'; -import { getEventList, getEventsCount, getProfileById } from '@openpanel/db'; -import type { IChartInput } from '@openpanel/validation'; +import { getProfileById } from '@openpanel/db'; -import { EventList } from '../../events/event-list'; +import EventListServer from '../../events/event-list'; import { StickyBelowHeader } from '../../layout-sticky-below-header'; import MostEventsServer from './most-events'; import PopularRoutesServer from './popular-routes'; import ProfileActivityServer from './profile-activity'; +import ProfileCharts from './profile-charts'; import ProfileMetrics from './profile-metrics'; interface PageProps { @@ -58,80 +52,8 @@ export default async function Page({ eventQueryFiltersParser.parseServerSide(searchParams.f ?? '') ?? undefined, }; - const startDate = parseAsString.parseServerSide(searchParams.startDate); - const endDate = parseAsString.parseServerSide(searchParams.endDate); const profile = await getProfileById(profileId, projectId); - const pageViewsChart: IChartInput = { - projectId, - startDate, - endDate, - chartType: 'linear', - events: [ - { - segment: 'event', - filters: [ - { - id: 'profile_id', - name: 'profile_id', - operator: 'is', - value: [profileId], - }, - ], - id: 'A', - name: '*', - displayName: 'Events', - }, - ], - breakdowns: [ - { - id: 'path', - name: 'path', - }, - ], - lineType: 'monotone', - interval: 'day', - name: 'Events', - range: '30d', - previous: false, - metric: 'sum', - }; - - const eventsChart: IChartInput = { - projectId, - startDate, - endDate, - chartType: 'linear', - events: [ - { - segment: 'event', - filters: [ - { - id: 'profile_id', - name: 'profile_id', - operator: 'is', - value: [profileId], - }, - ], - id: 'A', - name: '*', - displayName: 'Events', - }, - ], - breakdowns: [ - { - id: 'name', - name: 'name', - }, - ], - lineType: 'monotone', - interval: 'day', - name: 'Events', - range: '30d', - previous: false, - metric: 'sum', - }; - if (!profile) { return notFound(); } @@ -169,37 +91,13 @@ export default async function Page({