mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-05-06 03:29:35 +00:00
20 lines
448 B
Lua
20 lines
448 B
Lua
--- Render a single post component
|
|
---@param post Post Post data
|
|
---@return PostComponent Post component
|
|
local function render_post(post)
|
|
return {
|
|
type = "feed_post",
|
|
props = {
|
|
id = post.id,
|
|
author = post.author,
|
|
avatar = post.avatar,
|
|
content = post.content,
|
|
timestamp = post.created_at,
|
|
likes = post.likes or 0,
|
|
comments = post.comments or 0
|
|
}
|
|
}
|
|
end
|
|
|
|
return render_post
|