perf: add subtitle for each page

This commit is contained in:
Junyan Qin
2025-05-10 15:49:39 +08:00
parent e914d93c25
commit 3a6b9b0287
5 changed files with 28 additions and 6 deletions
+3 -1
View File
@@ -12,8 +12,10 @@ export default function HomeLayout({
children: React.ReactNode;
}>) {
const [title, setTitle] = useState<string>('');
const [subtitle, setSubtitle] = useState<string>('');
const onSelectedChangeAction = (child: SidebarChildVO) => {
setTitle(child.name);
setSubtitle(child.description);
};
return (
@@ -23,7 +25,7 @@ export default function HomeLayout({
</aside>
<div className={styles.main}>
<HomeTitleBar title={title} />
<HomeTitleBar title={title} subtitle={subtitle} />
<main className={styles.mainContent}>{children}</main>
</div>