ci/woodpecker/push/woodpecker Pipeline was successful
Undo the full-tree rollback in 6ea1b3d and restore the pre-rollback v1.2.0 code. Preserve the new asset flow rules, abnormal inventory separation, range drilldowns and date picker; adapt the regression test to the restored routes layout.
34 lines
1.2 KiB
TypeScript
34 lines
1.2 KiB
TypeScript
import { LayoutDashboard, CalendarDays } from 'lucide-react';
|
|
import { AnimatePresence } from 'motion/react';
|
|
import ElectricView, { type ElectricSubTab } from './ElectricView';
|
|
import SubTabs from './SubTabs';
|
|
import { useHashSubTab } from './useHashSubTab';
|
|
import { FadeIn, PageFrame } from '../../components/ui/surface';
|
|
|
|
const SUB_TABS = [
|
|
{ id: 'daily', label: '按日', icon: CalendarDays },
|
|
{ id: 'overview', label: '总览', icon: LayoutDashboard },
|
|
] as const satisfies readonly { id: ElectricSubTab; label: string; icon: typeof CalendarDays }[];
|
|
|
|
const SUB_IDS: readonly ElectricSubTab[] = ['daily', 'overview'];
|
|
|
|
export default function ElectricModule() {
|
|
const [sub, setSub] = useHashSubTab<ElectricSubTab>('electric', SUB_IDS);
|
|
return (
|
|
<PageFrame
|
|
title="电能经营看板"
|
|
subtitle="充电量、费用、日趋势与车辆归属"
|
|
icon={CalendarDays}
|
|
eyebrow="ELECTRIC BI"
|
|
meta="按日 · 总览"
|
|
>
|
|
<SubTabs tabs={SUB_TABS} active={sub} onChange={setSub} />
|
|
<AnimatePresence mode="wait">
|
|
<FadeIn key={sub}>
|
|
<ElectricView sub={sub} />
|
|
</FadeIn>
|
|
</AnimatePresence>
|
|
</PageFrame>
|
|
);
|
|
}
|