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",
                    },
                    xIcon = {
                        type = "description",
                        order = 2,
                        width = "full",
                        name = "|cffffffff" .. (L["options_x_link"] or "Follow on X (copy this link, optional)") .. "|r",
                        image = "Interface\\AddOns\\CritMatic\\Media\\Textures\\x-logo.tga",
                        imageWidth = 24,
                        imageHeight = 24,
                        fontSize = "medium",
                    },
                    xLink = {
                        name = "",
                        desc = L["options_x_link_desc"] or "Optional. Copy this link and open it in your browser.",
                        type = "input",
                        order = 3,
                        width = "full",
                        get = function() return "https://x.com/infiniteloopalc" end,
                        set = function() end,
                    },
                    gearmaticIcon = {
                        type = "description",
                        order = 4,
                        width = "full",
                        name = "|cffffffff" .. (L["options_gearmatic_link"] or "GearMatic (copy this link, optional)") .. "|r",
                        image = "Interface\\AddOns\\CritMatic\\Media\\Textures\\gearmatic-icon.tga",
                        imageWidth = 24,
                        imageHeight = 24,
                        fontSize = "medium",
                    },
                    gearmaticLink = {
                        name = "",
                        desc = L["options_gearmatic_link_desc"] or "Optional. Copy this link and open it in your browser.",
                        type = "input",
                        order = 5,
                        width = "full",
                        get = function() return "https://www.curseforge.com/wow/addons/gearmatic" end,
                        set = function() end,
                    },
                    repmaticIcon = {
                        type = "description",
                        order = 6,
                        width = "full",
                        name = "|cffffffff" .. (L["options_repmatic_link"] or "RepMatic (copy this link, optional)") .. "|r",
                        image = "Interface\\AddOns\\CritMatic\\Media\\Textures\\repmatic-icon.tga",
                        imageWidth = 24,
                        imageHeight = 24,
                        fontSize = "medium",
                    },
                    repmaticLink = {
                        name = "",
                        desc = L["options_repmatic_link_desc"] or "Optional. Copy this link and open it in your browser.",
                        type = "input",
                        order = 7,
                        width = "full",
                        get = function() return "https://www.curseforge.com/wow/addons/repmatic" end,
                        set = function() end,
                    },
                },
            },
        }
    }
end
