<template>
	<view>
		<LiveUserNickPanel :show="userlogo" @confirm="$emit('confirm-nickname')"
			@nickname-input="$emit('nickname-input', $event)" @close="$emit('update:userlogo', false)" />

		<LiveLotteryPopPanel :show="isShowLotteryPop" :countdown="countdown" :products="lotteryProducts"
			@close="$emit('update:isShowLotteryPop', false)" @claim="$emit('lottery-claim')" />

		<LiveQuizPanel :show="liveQuizSheetVisible" :quiz="liveQuiz" :option-list="liveQuizOptionList"
			:can-submit="liveQuizCanSubmit" :has-selection="hasQuizSelection"
			:is-option-selected="isQuizOptionSelected" @close="$emit('quiz-close')"
			@select-option="$emit('quiz-select', $event)" @submit="$emit('quiz-submit')" />

		<LiveIntegralPanel :show-completion="shouldShowIntegralPopup" :show-duration="!!integralStatus"
			:integral-msg="integralMsg" @close-duration="$emit('integral-close')" />

		<LiveRedPanel :show="isShowRed" @close="$emit('update:isShowRed', false)" @claim="$emit('red-claim')" />

		<LiveLotteryConfirmPanel :show="isShowLottery" :countdown="countdown"
			@close="$emit('update:isShowLottery', false)" @confirm="$emit('lottery-confirm')" />

		<LiveRedCardPanel :show="isShowRedCard" :card="redCard" @close="$emit('update:isShowRedCard', false)" />

		<LiveNoticePopPanel :show="isShowPopMsg" :message="popMsg"
			@close="$emit('update:isShowPopMsg', false)" />

		<LivePrizePanel :show="isShowPrize && havePrize" :is-won="isCurrentUserWon" :prize-info="prizeInfo"
			@confirm="$emit('prize-confirm')" @fill-address="$emit('prize-fill-address')" />

		<LiveWinningRecordPanel :show="winning" :records="prizeAll" @close="$emit('winning-close')"
			@fill-address="$emit('winning-fill-address', $event)" />

		<LiveMoreMenu :show="isMore" @close="$emit('more-close')" @integral="$emit('more-integral')"
			@exchange="$emit('more-exchange')" @winning-record="$emit('more-winning-record')" />

		<LiveCouponPanel :show="isShowCoupon" :coupon="couponInfo" @close="$emit('update:isShowCoupon', false)"
			@claim="$emit('coupon-claim')" />
	</view>
</template>

<script>
import LiveUserNickPanel from './LiveUserNickPanel.vue'
import LiveLotteryPopPanel from './LiveLotteryPopPanel.vue'
import LiveQuizPanel from './LiveQuizPanel.vue'
import LiveIntegralPanel from './LiveIntegralPanel.vue'
import LiveRedPanel from './LiveRedPanel.vue'
import LiveLotteryConfirmPanel from './LiveLotteryConfirmPanel.vue'
import LiveRedCardPanel from './LiveRedCardPanel.vue'
import LiveNoticePopPanel from './LiveNoticePopPanel.vue'
import LivePrizePanel from './LivePrizePanel.vue'
import LiveWinningRecordPanel from './LiveWinningRecordPanel.vue'
import LiveMoreMenu from './LiveMoreMenu.vue'
import LiveCouponPanel from './LiveCouponPanel.vue'

export default {
	name: 'LiveActivityHost',
	components: {
		LiveUserNickPanel,
		LiveLotteryPopPanel,
		LiveQuizPanel,
		LiveIntegralPanel,
		LiveRedPanel,
		LiveLotteryConfirmPanel,
		LiveRedCardPanel,
		LiveNoticePopPanel,
		LivePrizePanel,
		LiveWinningRecordPanel,
		LiveMoreMenu,
		LiveCouponPanel
	},
	props: {
		userlogo: { type: Boolean, default: false },
		isShowLotteryPop: { type: Boolean, default: false },
		liveQuizSheetVisible: { type: Boolean, default: false },
		shouldShowIntegralPopup: { type: Boolean, default: false },
		isShowRed: { type: Boolean, default: false },
		isShowLottery: { type: Boolean, default: false },
		isShowRedCard: { type: Boolean, default: false },
		isShowPopMsg: { type: Boolean, default: false },
		isShowPrize: { type: Boolean, default: false },
		havePrize: { type: Boolean, default: false },
		winning: { type: Boolean, default: false },
		isMore: { type: Boolean, default: false },
		isShowCoupon: { type: Boolean, default: false },
		countdown: { type: Object, default: () => ({}) },
		lotteryProducts: { type: Array, default: () => [] },
		liveQuiz: { type: Object, default: () => ({}) },
		liveQuizOptionList: { type: Array, default: () => [] },
		liveQuizCanSubmit: { type: Boolean, default: true },
		hasQuizSelection: { type: Boolean, default: false },
		isQuizOptionSelected: { type: Function, default: () => false },
		integralStatus: { type: [Boolean, Number, String], default: false },
		integralMsg: { type: String, default: '' },
		redCard: { type: Object, default: null },
		popMsg: { type: String, default: '' },
		isCurrentUserWon: { type: Boolean, default: false },
		prizeInfo: { type: Array, default: () => [] },
		prizeAll: { type: Array, default: () => [] },
		couponInfo: { type: Object, default: () => ({}) }
	}
}
</script>
