* esm * wip * wip * wip * wip * wip * wip * subscription notice * wip * wip * wip * fix envs * fix: update docker build * fix * esm/types * delete dashboard :D * add patches to dockerfiles * update packages + catalogs + ts * wip * remove native libs * ts * improvements * fix redirects and fetching session * try fix favicon * fixes * fix * order and resize reportds within a dashboard * improvements * wip * added userjot to dashboard * fix * add op * wip * different cache key * improve date picker * fix table * event details loading * redo onboarding completely * fix login * fix * fix * extend session, billing and improve bars * fix * reduce price on 10M
36 lines
1020 B
TypeScript
36 lines
1020 B
TypeScript
import { EventsTable } from '@/components/events/table';
|
|
import { useTRPC } from '@/integrations/trpc/react';
|
|
import { useInfiniteQuery } from '@tanstack/react-query';
|
|
import { createFileRoute } from '@tanstack/react-router';
|
|
import { parseAsIsoDateTime, useQueryState } from 'nuqs';
|
|
|
|
export const Route = createFileRoute(
|
|
'/_app/$organizationId/$projectId_/events/_tabs/conversions',
|
|
)({
|
|
component: Component,
|
|
});
|
|
|
|
function Component() {
|
|
const { projectId } = Route.useParams();
|
|
const trpc = useTRPC();
|
|
const [startDate, setStartDate] = useQueryState(
|
|
'startDate',
|
|
parseAsIsoDateTime,
|
|
);
|
|
const [endDate, setEndDate] = useQueryState('endDate', parseAsIsoDateTime);
|
|
const query = useInfiniteQuery(
|
|
trpc.event.conversions.infiniteQueryOptions(
|
|
{
|
|
projectId,
|
|
startDate: startDate || undefined,
|
|
endDate: endDate || undefined,
|
|
},
|
|
{
|
|
getNextPageParam: (lastPage) => lastPage.meta.next,
|
|
},
|
|
),
|
|
);
|
|
|
|
return <EventsTable query={query} />;
|
|
}
|