Critmatic = Critmatic or {}
local L = LibStub("AceLocale-3.0"):GetLocale("CritMatic")
function Critmatic:GeneralTab_Initialize()
    -- Define your general tab options here
    return {
        name = L["options_general"],
        type = "group",
        order = 1,
        args = {

            critLogEnabled = {
                name = L["options_show_crit_log"],
                desc = L["options_show_crit_log_desc"],
                type = "toggle",
                order = 1,
                set = function(_, newVal)
                    if newVal ~= Critmatic.db.profile.isCritLogFrameShown then
                        toggleCritMaticCritLog()
                    end
                end,
                get = function()
                    return Critmatic.db.profile.isCritLogFrameShown
                end,
            },
            critLogLocked = {
                name = L["options_lock_crit_log"],
                desc = L["options_lock_crit_log_desc"],
                type = "toggle",
                order = 1.5,
                set = function(_, newVal)
                    Critmatic.db.profile.critLogWidgetPos.lock = newVal
                end,
                get = function()
                    return Critmatic.db.profile.critLogWidgetPos.lock
                end,
            },
            alertNotificationsEnabled = {
                name = L["options_show_alert_notifications"],
                desc = L["options_show_alert_notifications_desc"],
                type = "toggle",
                order = 2,
                set = function(_, newVal)
                    Critmatic.db.profile.generalSettings.alertNotificationsEnabled = newVal
                end,
                get = function()
                    return Critmatic.db.profile.generalSettings.alertNotificationsEnabled
                end,
            },
            chatNotificationsEnabled = {
                name = L["options_show_chat_notifications"],
                desc = L["options_show_chat_notifications_desc"],
                type = "toggle",
                order = 3,
                set = function(_, newVal)
                    Critmatic.db.profile.generalSettings.chatNotificationsEnabled = newVal
                end,
                get = function()
                    return Critmatic.db.profile.generalSettings.chatNotificationsEnabled
                end,
            },
            isChangeLogAutoPopUpEnabled = {
                name = L["options_show_change_log"],
                desc = L["options_show_change_log_desc"],
                type = "toggle",
                order = 4,
                set = function(_, newVal)
                    Critmatic.db.profile.generalSettings.isChangeLogAutoPopUpEnabled = newVal
                end,
                get = function()
                    return Critmatic.db.profile.generalSettings.isChangeLogAutoPopUpEnabled
                end,
            },
            critsOnlyEnabled = {
                name = L["options_crits_only"],
                desc = L["options_crits_only_desc"],
                type = "toggle",
                order = 5,
                set = function(_, newVal)
                    Critmatic.db.profile.generalSettings.critsOnlyEnabled = newVal
                end,
                get = function()
                    return Critmatic.db.profile.generalSettings.critsOnlyEnabled
                end,
            },
            supportGroup = {
                type = "group",
                inline = true,
                order = 90,
                name = L["options_support"] or "Support",
                args = {
                    discordLink = {
                        name = L["options_discord_link"],
                        desc = L["options_discord_link_desc"],
                        type = "input",
                        order = 1,
                        width = "full",
                        get = function() return "https://discord.gg/34JJyrnGGC" end,
                        set = function() end,
                    },
                    bmacIcon = {
                        type = "description",
                        order = 2,
                        width = "full",
                        name = "|cffffd700" .. (L["options_bmac_link"] or "Buy Me A Coffee (copy this link, optional)") .. "|r",
                        image = "Interface\\AddOns\\CritMatic\\Media\\Textures\\bmc-logo.tga",
                        imageWidth = 24,
                        imageHeight = 24,
                        fontSize = "medium",
                    },
                    bmacLink = {
                        name = "",
                        desc = L["options_bmac_link_desc"] or "Optional. Copy this link and open it in your browser.",
                        type = "input",
                        order = 3,
                        width = "full",
                        get = function() return "https://buymeacoffee.com/infiniteloopalchemist" end,
                        set = function() end,
                    },
                },
            },
            byGroup = {
                type = "group",
                inline = true,
                order = 99,
                name = L["options_about"] or "By",
                args = {
                    profile = {
                        type = "description",
                        order = 1,
                        width = "full",
                        name = "Infinite Loop Alchemist",
                        image = "Interface\\AddOns\\CritMatic\\Media\\Textures\\profile.tga",
                        imageWidth = 30,
                        imageHeight = 30,
                        fontSize = "large",
                    },
                },
            },
        }
    }
end
