local pluginName, pluginShared = ...
local L = LibStub("AceLocale-3.0"):GetLocale("AppearanceMatic")

local function BuildSpec()
    local db = pluginShared.db and pluginShared.db.profile
    return {
        title = "AppearanceMatic - " .. L["clp_title"],
        footer = L["clp_status"],
        version = tostring((pluginShared.Core and pluginShared.Core.version) or ""),
        style = db and db.changeLogPopUp or nil,
        entries = {
            {
                version = "0.5.2",
                date = "08/31/2026",
                sections = {
                    { label = L["clp_0_5_2_1_label"], body = L["clp_0_5_2_1_body"] },
                    { label = L["clp_0_5_2_2_label"], body = L["clp_0_5_2_2_body"] },
                },
            },
            {
                version = "0.5.1",
                date = "08/31/2026",
                sections = {
                    { label = L["clp_0_5_1_1_label"], body = L["clp_0_5_1_1_body"] },
                    { label = L["clp_0_5_1_2_label"], body = L["clp_0_5_1_2_body"] },
                },
            },
            {
                version = "0.5.0",
                date = "08/30/2026",
                sections = {
                    { label = L["clp_0_5_0_1_label"], body = L["clp_0_5_0_1_body"] },
                    { label = L["clp_0_5_0_2_label"], body = L["clp_0_5_0_2_body"] },
                },
            },
        },
    }
end

function pluginShared.ShowChangeLog()
    local lib = LibStub("LibMatic-ChangeLog-1.0", true)
    if not lib then
        return
    end
    lib:Show(BuildSpec())
end
