Files
metabuilder/packages/ui_level3/seed/scripts/layout.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

53 lines
1.5 KiB
Lua

local M = {}
function M.render(ctx)
return {
type = "Box",
props = { className = "min-h-screen bg-background" },
children = {
{ type = "AppHeader", props = { title = "Admin Panel", username = ctx.user.username, showBadge = true, variant = "admin" } },
{
type = "Container",
props = { className = "max-w-7xl mx-auto px-4 py-8 space-y-8" },
children = {
{ type = "IntroSection", props = { eyebrow = "Level 3", title = "Data Management", description = "Manage users and content." } },
M.stats(ctx),
M.tabs()
}
}
}
}
end
function M.stats(ctx)
return {
type = "Grid",
props = { cols = 3, gap = 4 },
children = {
{ type = "StatCard", props = { label = "Users", value = ctx.userCount or 0 } },
{ type = "StatCard", props = { label = "Comments", value = ctx.commentCount or 0 } },
{ type = "StatCard", props = { label = "Flagged", value = ctx.flaggedCount or 0 } }
}
}
end
function M.tabs()
return {
type = "Tabs",
props = { defaultValue = "users" },
children = {
{
type = "TabsList",
children = {
{ type = "TabsTrigger", props = { value = "users", text = "Users" } },
{ type = "TabsTrigger", props = { value = "comments", text = "Comments" } }
}
},
{ type = "TabsContent", props = { value = "users" }, children = { { type = "UsersTable" } } },
{ type = "TabsContent", props = { value = "comments" }, children = { { type = "CommentsTable" } } }
}
}
end
return M