diff --git a/packages/ui_level2/seed/scripts/profile.lua b/packages/ui_level2/seed/scripts/profile.lua index d06ed5165..ac09b5c3d 100644 --- a/packages/ui_level2/seed/scripts/profile.lua +++ b/packages/ui_level2/seed/scripts/profile.lua @@ -1,51 +1,3 @@ --- Profile component module - ----@class UIComponent ----@field type string ----@field props? table ----@field children? UIComponent[] - ----@class RenderContext ----@field user table ----@field user.username string ----@field user.email? string - ----@class FormData ----@field email string - ----@class ProfileResponse ----@field success boolean ----@field action string ----@field email string - ----@type table -local M = {} - ----Renders the user profile card with form inputs ----@param ctx RenderContext ----@return UIComponent -function M.render(ctx) - return { - type = "Card", - children = { - { type = "CardHeader", children = { { type = "CardTitle", props = { text = "Your Profile" } } } }, - { - type = "CardContent", - children = { - { type = "Input", props = { label = "Username", value = ctx.user.username, disabled = true } }, - { type = "Input", props = { label = "Email", name = "email", value = ctx.user.email or "" } }, - { type = "Button", props = { text = "Save Changes", onClick = "saveProfile" } } - } - } - } - } -end - ----Processes profile form submission and returns response ----@param form FormData ----@return ProfileResponse -function M.saveProfile(form) - return { success = true, action = "update_profile", email = form.email } -end - -return M +-- Profile module redirect +-- Functions split into profile/ directory for 1-function-per-file pattern +return require("profile.init")