Skip to content
Merged
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 @@ -75,7 +75,7 @@ export function ResponseTimeAnalytics({
error={error}
loadingComponent={<Skeleton className="h-[400px] rounded" />}
>
{data && (
{data?.summary && (
<div className="space-y-4">
{data.emailsAnalyzed > 0 && (
<p className="text-muted-foreground text-sm">
Expand Down
60 changes: 42 additions & 18 deletions apps/web/app/(app)/[emailAccountId]/stats/Stats.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ import { ActionBar } from "@/app/(app)/[emailAccountId]/stats/ActionBar";
import { DetailedStatsFilter } from "@/app/(app)/[emailAccountId]/stats/DetailedStatsFilter";
import { LayoutGrid } from "lucide-react";
import { DatePickerWithRange } from "@/components/DatePickerWithRange";
import { ErrorBoundary } from "@/components/ErrorBoundary";
import { CardBasic } from "@/components/ui/card";

const selectOptions = [
{ label: "Last week", value: "7" },
Expand Down Expand Up @@ -114,26 +116,48 @@ export function Stats() {
/>
</ActionBar>
<div className="grid gap-2 sm:gap-4 mt-2 sm:mt-4">
<StatsSummary
dateRange={dateRange}
refreshInterval={refreshInterval}
period={period}
/>
<EmailAnalytics
dateRange={dateRange}
refreshInterval={refreshInterval}
/>
<ResponseTimeAnalytics
dateRange={dateRange}
refreshInterval={refreshInterval}
/>
<RuleStatsChart
dateRange={dateRange}
title="Assistant processed emails"
/>
{isAccountOwner && <EmailActionsAnalytics />}
<ErrorBoundary fallback={<SectionError title="Summary" />}>
<StatsSummary
dateRange={dateRange}
refreshInterval={refreshInterval}
period={period}
/>
</ErrorBoundary>
<ErrorBoundary fallback={<SectionError title="Email Analytics" />}>
<EmailAnalytics
dateRange={dateRange}
refreshInterval={refreshInterval}
/>
</ErrorBoundary>
<ErrorBoundary fallback={<SectionError title="Response Time" />}>
<ResponseTimeAnalytics
dateRange={dateRange}
refreshInterval={refreshInterval}
/>
</ErrorBoundary>
<ErrorBoundary fallback={<SectionError title="Rule Stats" />}>
<RuleStatsChart
dateRange={dateRange}
title="Assistant processed emails"
/>
</ErrorBoundary>
{isAccountOwner && (
<ErrorBoundary fallback={<SectionError title="Email Actions" />}>
<EmailActionsAnalytics />
</ErrorBoundary>
)}
</div>
<StatsOnboarding />
</PageWrapper>
);
}

function SectionError({ title }: { title: string }) {
return (
<CardBasic>
<p className="text-muted-foreground">
Unable to load {title}. Please try refreshing the page.
</p>
</CardBasic>
);
}
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v2.21.56
v2.21.57
Loading