Files
metabuilder/packages/ui_level3/seed/scripts/users.lua
T
git f3b1058d62 feat(ui): Add UI components for header, intro, and user dashboard
- Implemented App Header with lifecycle and rendering scripts.
- Created Intro Section with rendering logic.
- Developed User Dashboard with profile, comments, and chat functionalities.
- Added Admin Panel for user and content management.
- Introduced Application Builder with schemas and workflows.
- Established Super God panel for tenant management.
- Updated metadata and tests for all new components and functionalities.
- Enhanced UI Pages Bundle to include dependencies for all levels.
- Improved permission checks and constants in the permissions package.
2025-12-29 23:31:43 +00:00

36 lines
1.1 KiB
Lua

local M = {}
function M.render(ctx)
local rows = {}
for _, u in ipairs(ctx.users or {}) do
rows[#rows + 1] = {
type = "TableRow",
children = {
{ type = "TableCell", props = { text = u.username } },
{ type = "TableCell", props = { text = u.email or "-" } },
{ type = "TableCell", props = { text = u.role } },
{ type = "TableCell", children = {
{ type = "Button", props = { size = "sm", text = "Edit", onClick = "editUser", data = u.id } },
{ type = "Button", props = { size = "sm", variant = "destructive", text = "Delete", onClick = "deleteUser", data = u.id } }
}}
}
}
end
return {
type = "Table",
children = {
{ type = "TableHeader", children = {
{ type = "TableRow", children = {
{ type = "TableHead", props = { text = "Username" } },
{ type = "TableHead", props = { text = "Email" } },
{ type = "TableHead", props = { text = "Role" } },
{ type = "TableHead", props = { text = "Actions" } }
}}
}},
{ type = "TableBody", children = rows }
}
}
end
return M