Files
kandev/apps/web/components/system-metrics/topbar-metrics.tsx
T
José Almeida 9c16d337a2 feat(web): add global app status surface (#1869)
* feat(web): add app status bar

* feat(web): add app status bar visibility toggle

* feat(web): persist status bar item order

* fix(web): refine app status bar behavior

* fix(web): polish app status bar presentation

* test(web): split plugin slot coverage groups

* fix(web): address status surface review feedback

* fix(web): stabilize status bar overlay tests
2026-07-23 12:28:54 +01:00

30 lines
909 B
TypeScript

"use client";
import { useAppStore } from "@/components/state-provider";
import { useFeature } from "@/hooks/domains/features/use-feature";
import { StatusSurfaceMetrics } from "./status-surface-metrics";
type TopbarMetricsProps = {
activeSessionId?: string | null;
size?: "sm" | "lg";
};
/** Preserves pre-status-bar metrics until the new surface is enabled. */
export function TopbarMetrics({ size = "lg" }: TopbarMetricsProps) {
const statusBarEnabled = useFeature("appStatusBar");
const metricsEnabled = useAppStore(
(state) => state.userSettings.systemMetricsDisplay.showInTopbar,
);
if (statusBarEnabled || !metricsEnabled) return null;
return (
<div
className={`flex items-center overflow-hidden ${size === "sm" ? "h-7" : "h-8"}`}
data-testid="topbar-metrics"
>
<StatusSurfaceMetrics presentation="bar" density="compact" drawerOpen />
</div>
);
}