local WindUI = require("../src/init")


local Window = WindUI:CreateWindow({
    Title = "Random WindUI Elements",
    Icon = "box",
    Author = "Generated by Manus",
    Size = UDim2.fromOffset(800, 600),
    Resizable = true,
})

local Tab = Window:Tab({ Title = "Elements" })

local function generateRandomString(length)
    local chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
    local randomString = ""
    for i = 1, length do
        randomString = randomString .. chars:sub(math.random(1, #chars), math.random(1, #chars))
    end
    return randomString
end

math.randomseed(os.time())

for i = 1, 200 do
    local elementType = math.random(1, 3) -- 1: Button, 2: Dropdown, 3: Input
    local elementTitle = "Element " .. i .. " - " .. generateRandomString(2)
    local elementDesc = "Description for " .. elementTitle .. " - " .. generateRandomString(4)

    if elementType == 1 then
        -- Button
        Tab:Button({
            Title = elementTitle,
            Desc = elementDesc,
            Callback = function()
                print("Button '" .. elementTitle .. "' clicked!")
            end
        })
    elseif elementType == 2 then
        -- Dropdown
        local values = {"Option A", "Option B", "Option C", "Option D"}
        local randomValue = values[math.random(1, #values)]
        Tab:Dropdown({
            Title = elementTitle,
            Values = values,
            Value = randomValue,
            Callback = function(option)
                print("Dropdown '" .. elementTitle .. "' selected: " .. option)
            end
        })
    elseif elementType == 3 then
        -- Input
        Tab:Input({
            Title = elementTitle,
            Desc = elementDesc,
            Value = generateRandomString(8),
            Type = "Input",
            Placeholder = "Enter text...",
            Callback = function(input)
                print("Input '" .. elementTitle .. "' entered: " .. input)
            end
        })
    end
end