import { useState } from "react"; import { App as AntApp, ConfigProvider, Tabs } from "antd"; import zhCN from "antd/locale/zh_CN"; import { CalculatorPanel } from "./CalculatorPanel"; import { HistoryTab } from "./HistoryTab"; import { UpdateButton } from "./UpdateButton"; import type { SampleInput } from "./types"; function Brand() { return (
建筑材料放射性判定分析
); } function App() { const [activeTab, setActiveTab] = useState("calc"); const [reloadSignal, setReloadSignal] = useState(0); // 复算:带入历史 input 并强制重挂 CalculatorPanel(key 递增)。 const [loadedInput, setLoadedInput] = useState(undefined); const [calcKey, setCalcKey] = useState(0); const recompute = (input: SampleInput) => { setLoadedInput(input); setCalcKey((k) => k + 1); setActiveTab("calc"); }; return (
, right: }} items={[ { key: "calc", label: "计算", children: ( setReloadSignal((s) => s + 1)} /> ) }, { key: "history", label: "历史记录", children: ( ) } ]} />
); } export { App };