mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-05-04 02:34:52 +00:00
bf1401fe34
- Added type annotations and class definitions in the dashboard layout, stats, and data table modules for improved type safety and documentation. - Introduced new classes for UI components, props, and configuration in the form builder, navigation menu, notification center, and UI dialogs packages. - Implemented detailed type definitions for actions, fields, and pagination components to streamline usage and enhance clarity. - Updated initialization functions in multiple packages to include versioning and installation context. - Improved structure and readability of the codebase by organizing and documenting component properties and methods.
34 lines
1.0 KiB
Lua
34 lines
1.0 KiB
Lua
---@class AccessDenied
|
|
local M = {}
|
|
|
|
---@class DeniedProps
|
|
---@field title? string
|
|
---@field description? string
|
|
---@field actionLabel? string
|
|
---@field onAction? string
|
|
|
|
---@class UIComponent
|
|
---@field type string
|
|
---@field props? table
|
|
---@field children? table
|
|
|
|
---@param props DeniedProps
|
|
---@return UIComponent
|
|
function M.render(props)
|
|
return {
|
|
type = "Stack",
|
|
props = { spacing = 2, className = "items-center justify-center min-h-[50vh] text-center" },
|
|
children = {
|
|
{ type = "Icon", props = { name = "lock", size = 48, className = "text-muted-foreground" } },
|
|
{ type = "Typography", props = { variant = "h5", text = props.title or "Access restricted" } },
|
|
{ type = "Typography", props = { variant = "body2", text = props.description or "You don't have permission.", className = "text-muted-foreground" } },
|
|
props.actionLabel and {
|
|
type = "Button",
|
|
props = { variant = "contained", text = props.actionLabel, onClick = props.onAction or "goBack" }
|
|
} or nil
|
|
}
|
|
}
|
|
end
|
|
|
|
return M
|