mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-04-24 13:54:57 +00:00
feat(nav_menu): implement menu item, group, and divider components feat(ui_header): create logo, user, and actions sections for header rendering
27 lines
636 B
Lua
27 lines
636 B
Lua
-- Header user section
|
|
local function user_section(user)
|
|
if not user then
|
|
return {
|
|
type = "auth_buttons",
|
|
children = {
|
|
{ type = "button", label = "Login", action = "navigate", path = "/login" },
|
|
{ type = "button", label = "Sign Up", action = "navigate", path = "/register" }
|
|
}
|
|
}
|
|
end
|
|
|
|
return {
|
|
type = "user_menu",
|
|
avatar = user.avatar,
|
|
name = user.name,
|
|
items = {
|
|
{ label = "Profile", path = "/profile" },
|
|
{ label = "Settings", path = "/settings" },
|
|
{ type = "divider" },
|
|
{ label = "Logout", action = "logout" }
|
|
}
|
|
}
|
|
end
|
|
|
|
return user_section
|