feat: Next.js 14 web admin scaffold — auth, sidebar, dashboard, placeholders

This commit is contained in:
Forge
2026-03-25 08:23:25 +08:00
parent dc01eac449
commit 310a9453de
37 changed files with 2755 additions and 292 deletions

31
lib/auth-store.ts Normal file
View File

@@ -0,0 +1,31 @@
import { create } from 'zustand';
import { persist } from 'zustand/middleware';
interface User {
id: string;
email: string;
firstName: string;
lastName: string;
roles: string[];
}
interface AuthState {
accessToken: string | null;
tenantSlug: string | null;
user: User | null;
setAuth: (data: { accessToken: string; tenantSlug: string; user: User }) => void;
logout: () => void;
}
export const useAuthStore = create<AuthState>()(
persist(
(set) => ({
accessToken: null,
tenantSlug: null,
user: null,
setAuth: (data) => set(data),
logout: () => set({ accessToken: null, tenantSlug: null, user: null }),
}),
{ name: 'fiberops_auth' }
)
);