Files
metabuilder/packages/ui_level3/seed/scripts/layout/tabs.lua
2025-12-30 12:41:29 +00:00

39 lines
945 B
Lua

-- Tabbed interface for admin panel
---@class UIComponent
---@field type string
---@field props table?
---@field children table[]?
local M = {}
---Creates tabbed interface for users and comments management
---@return UIComponent Tabs component with content sections
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