mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-04-26 14:54:55 +00:00
22 lines
554 B
Lua
22 lines
554 B
Lua
-- Dashboard stat trend indicator
|
|
|
|
---@class TrendIndicatorConfig
|
|
---@field type string
|
|
---@field direction string
|
|
---@field value string
|
|
---@field color string
|
|
|
|
---@param direction string Direction of trend: "up" or "down"
|
|
---@param value string Trend value to display
|
|
---@return TrendIndicatorConfig
|
|
local function trend_indicator(direction, value)
|
|
return {
|
|
type = "trend",
|
|
direction = direction, -- "up" or "down"
|
|
value = value,
|
|
color = direction == "up" and "success" or "error"
|
|
}
|
|
end
|
|
|
|
return trend_indicator
|