feat(auth): enhance header links with dynamic navigation and add setLinks method to store

This commit is contained in:
2026-02-25 01:50:27 +08:00
parent 0be8c66754
commit 8aad3bcb9b
3 changed files with 22 additions and 10 deletions

View File

@@ -34,6 +34,7 @@ export type LayoutStore = {
};
setLoginPageConfig: (config: Partial<LayoutStore['loginPageConfig']>) => void;
links: HeaderLink[];
setLinks: (links: HeaderLink[]) => void;
};
type HeaderLink = {
title?: string;
@@ -41,6 +42,7 @@ type HeaderLink = {
description?: string;
icon?: React.ReactNode;
key?: string;
isRoot?: boolean;
};
export const useLayoutStore = create<LayoutStore>((set, get) => ({
@@ -100,4 +102,5 @@ export const useLayoutStore = create<LayoutStore>((set, get) => ({
loginPageConfig: { ...state.loginPageConfig, ...config },
})),
links: [{ title: '', href: '/', key: 'home' }],
setLinks: (links) => set({ links }),
}));