dashboard: fix server imports in client
This commit is contained in:
@@ -10,6 +10,7 @@ import {
|
|||||||
eventQueryNamesFilter,
|
eventQueryNamesFilter,
|
||||||
} from '@/hooks/useEventQueryFilters';
|
} from '@/hooks/useEventQueryFilters';
|
||||||
import { getExists } from '@/server/pageExists';
|
import { getExists } from '@/server/pageExists';
|
||||||
|
import { getProfileName } from '@/utils/getters';
|
||||||
import { notFound } from 'next/navigation';
|
import { notFound } from 'next/navigation';
|
||||||
import { parseAsInteger, parseAsString } from 'nuqs';
|
import { parseAsInteger, parseAsString } from 'nuqs';
|
||||||
|
|
||||||
@@ -19,7 +20,6 @@ import {
|
|||||||
getEventList,
|
getEventList,
|
||||||
getEventsCount,
|
getEventsCount,
|
||||||
getProfileById,
|
getProfileById,
|
||||||
getProfileName,
|
|
||||||
} from '@openpanel/db';
|
} from '@openpanel/db';
|
||||||
import type { IChartEvent, IChartInput } from '@openpanel/validation';
|
import type { IChartEvent, IChartInput } from '@openpanel/validation';
|
||||||
|
|
||||||
|
|||||||
@@ -10,10 +10,10 @@ import { Widget, WidgetHead } from '@/components/widget';
|
|||||||
import { WidgetTable } from '@/components/widget-table';
|
import { WidgetTable } from '@/components/widget-table';
|
||||||
import { useAppParams } from '@/hooks/useAppParams';
|
import { useAppParams } from '@/hooks/useAppParams';
|
||||||
import { useCursor } from '@/hooks/useCursor';
|
import { useCursor } from '@/hooks/useCursor';
|
||||||
|
import { getProfileName } from '@/utils/getters';
|
||||||
import { UsersIcon } from 'lucide-react';
|
import { UsersIcon } from 'lucide-react';
|
||||||
import Link from 'next/link';
|
import Link from 'next/link';
|
||||||
|
|
||||||
import { getProfileName } from '@openpanel/db';
|
|
||||||
import type { IServiceProfile } from '@openpanel/db';
|
import type { IServiceProfile } from '@openpanel/db';
|
||||||
|
|
||||||
interface ProfileListProps {
|
interface ProfileListProps {
|
||||||
|
|||||||
@@ -2,9 +2,10 @@ import { ListPropertiesIcon } from '@/components/events/list-properties-icon';
|
|||||||
import { ProfileAvatar } from '@/components/profiles/profile-avatar';
|
import { ProfileAvatar } from '@/components/profiles/profile-avatar';
|
||||||
import { Widget, WidgetHead } from '@/components/widget';
|
import { Widget, WidgetHead } from '@/components/widget';
|
||||||
import { WidgetTable } from '@/components/widget-table';
|
import { WidgetTable } from '@/components/widget-table';
|
||||||
|
import { getProfileName } from '@/utils/getters';
|
||||||
import Link from 'next/link';
|
import Link from 'next/link';
|
||||||
|
|
||||||
import { chQuery, getProfileName, getProfiles } from '@openpanel/db';
|
import { chQuery, getProfiles } from '@openpanel/db';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
projectId: string;
|
projectId: string;
|
||||||
|
|||||||
6
apps/dashboard/src/utils/getters.ts
Normal file
6
apps/dashboard/src/utils/getters.ts
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
import type { IServiceProfile } from '@openpanel/db';
|
||||||
|
|
||||||
|
export function getProfileName(profile: IServiceProfile | undefined | null) {
|
||||||
|
if (!profile) return 'No name';
|
||||||
|
return [profile.firstName, profile.lastName].filter(Boolean).join(' ');
|
||||||
|
}
|
||||||
@@ -218,8 +218,3 @@ export async function upsertProfile({
|
|||||||
],
|
],
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getProfileName(profile: IServiceProfile | undefined | null) {
|
|
||||||
if (!profile) return 'No name';
|
|
||||||
return [profile.firstName, profile.lastName].filter(Boolean).join(' ');
|
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user