mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-04-30 16:54:57 +00:00
- 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.
50 lines
1.1 KiB
Lua
50 lines
1.1 KiB
Lua
local M = {}
|
|
|
|
function M.render(ctx)
|
|
return {
|
|
type = "Stack",
|
|
props = { spacing = 4 },
|
|
children = {
|
|
M.composer(),
|
|
M.list(ctx.comments or {})
|
|
}
|
|
}
|
|
end
|
|
|
|
function M.composer()
|
|
return {
|
|
type = "Card",
|
|
children = {
|
|
{ type = "CardContent", children = {
|
|
{ type = "TextArea", props = { name = "comment", placeholder = "Write a comment..." } },
|
|
{ type = "Button", props = { text = "Post", onClick = "postComment" } }
|
|
}}
|
|
}
|
|
}
|
|
end
|
|
|
|
function M.list(comments)
|
|
local items = {}
|
|
for _, c in ipairs(comments) do
|
|
items[#items + 1] = {
|
|
type = "Card",
|
|
children = {
|
|
{ type = "CardContent", children = {
|
|
{ type = "Typography", props = { text = c.content } },
|
|
{ type = "Typography", props = { variant = "caption", text = c.author } }
|
|
}}
|
|
}
|
|
}
|
|
end
|
|
return { type = "Stack", props = { spacing = 2 }, children = items }
|
|
end
|
|
|
|
function M.postComment(form)
|
|
if not form.comment or form.comment == "" then
|
|
return { success = false, error = "Comment required" }
|
|
end
|
|
return { success = true, action = "post_comment", content = form.comment }
|
|
end
|
|
|
|
return M
|