-- HousingDecorGuide/UI/Widgets/HDG_W_TypePill.lua
-- Tiny dim-uppercase label, typically anchored next to a header to indicate
-- the type/kind of the entity being inspected (CURATED / SMART SET / SNAPSHOT
-- / etc). Plain FontString — kept as a widget so callers don't reinvent the
-- color, font, and anchor pattern across tabs.
--
-- Usage:
--   local pill = HDG_W_TypePill:Create(parent)
--   pill.fs:SetPoint("LEFT", header, "RIGHT", 10, 0)
--   pill:SetText("CURATED")
--   pill:SetText(nil)  -- hides the label
--   pill:SetColor(r, g, b)  -- override default amber

local _, privateDB = ...

local M = {}
M.__index = M

local DEFAULT_COLOR = { r = 0.72, g = 0.58, b = 0.32, a = 1 } -- warm amber

function M:Create(parent, opts)
    opts = opts or {}
    local instance = setmetatable({}, M)

    local fs = parent:CreateFontString(nil, "OVERLAY", opts.font or "GameFontHighlightSmall")
    local c = opts.color or DEFAULT_COLOR
    fs:SetTextColor(c.r, c.g, c.b, c.a or 1)
    instance.fs = fs
    return instance
end

function M:SetText(text)
    if text and text ~= "" then
        self.fs:SetText(text)
        self.fs:Show()
    else
        self.fs:SetText("")
        self.fs:Hide()
    end
end

function M:SetColor(r, g, b, a) self.fs:SetTextColor(r, g, b, a or 1) end

if privateDB then privateDB.HDG_W_TypePill = M end
return M
