mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-04-30 00:34:56 +00:00
39 lines
915 B
Lua
39 lines
915 B
Lua
-- Intro page render component
|
|
|
|
---@class IntroProps
|
|
---@field eyebrow? string
|
|
---@field title? string
|
|
---@field description? string
|
|
|
|
---@class UIComponent
|
|
---@field type string
|
|
---@field props? table
|
|
---@field children? UIComponent[]
|
|
|
|
local M = {}
|
|
|
|
---@param props IntroProps
|
|
---@return UIComponent
|
|
function M.render(props)
|
|
return {
|
|
type = "Stack",
|
|
props = { spacing = 2 },
|
|
children = {
|
|
props.eyebrow and {
|
|
type = "Typography",
|
|
props = { variant = "overline", text = props.eyebrow, className = "text-primary" }
|
|
} or nil,
|
|
{
|
|
type = "Typography",
|
|
props = { variant = "h4", text = props.title or "Welcome" }
|
|
},
|
|
props.description and {
|
|
type = "Typography",
|
|
props = { variant = "body1", text = props.description, className = "text-muted-foreground" }
|
|
} or nil
|
|
}
|
|
}
|
|
end
|
|
|
|
return M
|