diff --git a/app/page.tsx b/app/page.tsx index 7e27f92..86a005c 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -1,5 +1,30 @@ import PublicLayout from "@/components/layout/PublicLayout"; +import { currentUserRole, isAdmin, isAuthenticated } from "@/lib/mock-auth"; export default function Page() { - return Home page content; + return ( + + + Home Page + + Current role: {currentUserRole} + + + {isAuthenticated() && ( + + User Action + + )} + {isAdmin() && ( + + Admin Only + + )} + + Public Action + + + + + ); } diff --git a/lib/mock-auth.ts b/lib/mock-auth.ts new file mode 100644 index 0000000..6c5f9d4 --- /dev/null +++ b/lib/mock-auth.ts @@ -0,0 +1,12 @@ +export type Role = "admin" | "user" | "guest"; + +// Change this value to test different UI states +export const currentUserRole: Role = "guest"; + +export function isAdmin(): boolean { + return currentUserRole === "admin"; +} + +export function isAuthenticated(): boolean { + return currentUserRole !== "guest"; +}
+ Current role: {currentUserRole} +