migrate to app dir and ssr
This commit is contained in:
12
apps/web/src/hooks/useEventNames.ts
Normal file
12
apps/web/src/hooks/useEventNames.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import { api } from '@/app/_trpc/client';
|
||||
|
||||
export function useEventNames(projectId: string) {
|
||||
const filterEventsQuery = api.chart.events.useQuery({
|
||||
projectId: projectId,
|
||||
});
|
||||
|
||||
return (filterEventsQuery.data ?? []).map((item) => ({
|
||||
value: item.name,
|
||||
label: item.name,
|
||||
}));
|
||||
}
|
||||
Reference in New Issue
Block a user