--[[
    Chooses between the different GuiTypes that the emotes can be displayed in
]]


local Roact = require(script.Parent.Parent.Packages.Roact)
local t = require(script.Parent.Parent.Packages.t)
local clientConfig = require(script.Parent.Parent.clientConfig)
local ConfigurationContext = require(script.Parent.Parent.Packages.Configuration).ConfigurationContext
local enums = require(script.Parent.Parent.enums)
local EmoteBarScreen = require(script.Parent.EmoteBarScreen)
local EmoteWheelBillboard = require(script.Parent.EmoteWheelBillboard)

local EmoteView = Roact.Component:extend("EmoteView")

EmoteView.defaultProps = {
	isVisible = true,
	forceHide = false,
}

EmoteView.validateProps = t.strictInterface({
	forceHide = t.boolean,
	isVisible = t.boolean,
	configuration = clientConfig.validate,
})

function EmoteView:render()
	local guiType = self.props.configuration.guiType

	if guiType == enums.GuiType.EmoteWheel then
		return Roact.createElement(EmoteWheelBillboard, {
			isVisible = self.props.isVisible,
		})
	else
		return Roact.createElement(EmoteBarScreen, {
			isVisible = self.props.isVisible and not self.props.forceHide,
		})
	end
end

return ConfigurationContext.withConfiguration(EmoteView)
