--[[
    Modifies a product or asset type (typically from its enum value) into
    something suitable to be displayed on screen:
    - With CamelCase words separated by spaces
    - With the word "Accessory" brought to the beginning, if present (this is to
      mirror the behavior in the Roblox catalog)
]]

local formatProductTypeString = function(input: string)
	local output = string.gsub(input, "(.)(%u)", "%1 %2")
	output = string.gsub(output, "(.*) Accessory", "Accessory | %1")
	output = string.gsub(output, "T Shirt", "T-Shirt")
	return output
end

return formatProductTypeString
