fix: handle profiles which are not identified but the event has profile_id
This commit is contained in:
@@ -5,6 +5,7 @@ import { formatDateTime } from '@/utils/date';
|
||||
import { parseAsStringEnum, useQueryState } from 'nuqs';
|
||||
|
||||
import type { IServiceEvent, IServiceProfile } from '@openpanel/db';
|
||||
import { FullPageEmptyState } from '../full-page-empty-state';
|
||||
import { WidgetButtons, WidgetHead } from '../overview/overview-widget';
|
||||
|
||||
type Props = {
|
||||
@@ -44,7 +45,7 @@ export const ProfileProperties = ({ profile }: Props) => {
|
||||
</WidgetButtons>
|
||||
</WidgetHead>
|
||||
|
||||
{tab === 'profile' && (
|
||||
{tab === 'profile' && profile && (
|
||||
<KeyValueGrid
|
||||
copyable
|
||||
className="border-0"
|
||||
@@ -92,7 +93,7 @@ export const ProfileProperties = ({ profile }: Props) => {
|
||||
/>
|
||||
)}
|
||||
|
||||
{tab === 'properties' && (
|
||||
{tab === 'properties' && profile && (
|
||||
<KeyValueGrid
|
||||
copyable
|
||||
className="border-0"
|
||||
@@ -109,6 +110,9 @@ export const ProfileProperties = ({ profile }: Props) => {
|
||||
}))}
|
||||
/>
|
||||
)}
|
||||
{(!profile || !profile.properties) && (
|
||||
<FullPageEmptyState title="No properties found" />
|
||||
)}
|
||||
</Widget>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user