feat(ui): add compact KPI metrics in tab bar (Total, Err%, Avg, P99)
New TabKpis component shows scope-aware metrics with trend arrows aligned right in the content tab bar. Each metric shows current value and an arrow indicating change vs previous period (green=good, red=bad). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { Tabs } from '@cameleer/design-system';
|
||||
import type { TabKey } from '../hooks/useScope';
|
||||
import type { TabKey, Scope } from '../hooks/useScope';
|
||||
import { TabKpis } from './TabKpis';
|
||||
import styles from './ContentTabs.module.css';
|
||||
|
||||
const TABS = [
|
||||
@@ -11,9 +12,10 @@ const TABS = [
|
||||
interface ContentTabsProps {
|
||||
active: TabKey;
|
||||
onChange: (tab: TabKey) => void;
|
||||
scope: Scope;
|
||||
}
|
||||
|
||||
export function ContentTabs({ active, onChange }: ContentTabsProps) {
|
||||
export function ContentTabs({ active, onChange, scope }: ContentTabsProps) {
|
||||
return (
|
||||
<div className={styles.wrapper}>
|
||||
<Tabs
|
||||
@@ -21,6 +23,7 @@ export function ContentTabs({ active, onChange }: ContentTabsProps) {
|
||||
active={active}
|
||||
onChange={(v) => onChange(v as TabKey)}
|
||||
/>
|
||||
<TabKpis scope={scope} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user