Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import {
UsageAnalyticsSidebar,
type PersonalView,
} from './UsageAnalyticsSidebar';
import { UsageProfileHero } from './UsageProfileHero';
import {
EMPTY_FILTERS,
defaultGranularityForPeriod,
Expand All @@ -38,6 +39,7 @@ import {
useUsageSummary,
useUsageTable,
useUsageTimeseries,
useUsageProfile,
type UsageFilters,
type ViewAs,
} from './hooks';
Expand Down Expand Up @@ -274,6 +276,13 @@ export function UsageAnalyticsDashboard({
limit: 500,
});

// Profile hook - only enabled for personal context
const {
data: usageProfile,
isLoading: usageProfileLoading,
error: usageProfileError,
} = useUsageProfile(context === 'personal');

// Resolve user ID -> email for labels whenever there is an effective org
// scope. Key off `effectiveOrgId` (not the prop `organizationId`) so that
// future paths which surface user-dimension data in personal-with-org mode
Expand Down Expand Up @@ -536,6 +545,13 @@ export function UsageAnalyticsDashboard({

<div className="flex-1 overflow-y-auto">
<div className="m-auto flex w-full max-w-[1140px] flex-col gap-6 p-4 md:p-6">
{context === 'personal' && (
<UsageProfileHero
profile={usageProfile}
loading={usageProfileLoading}
error={usageProfileError}
/>
)}
<UsageWarning />

{isOrgContext && organizationId && (
Expand Down
Loading