<template>
	<div
		class="px-5 py-10"
		v-if="$team?.pg"
		:class="{
			'h-max min-h-full sm:bg-gray-50':
				!$team.pg.onboarding.is_saas_user &&
				!$team.pg.onboarding.site_created,
		}"
	>
		<OnboardingWithoutPayment />
	</div>
</template>
<script>
import { getTeam } from '../../data/team';
import Onboarding from '../../components/Onboarding.vue';
import OnboardingWithoutPayment from '../../components/OnboardingWithoutPayment.vue';
export default {
	name: '欢迎',
	components: {
		Onboarding,
		OnboardingWithoutPayment,
	},
	beforeRouteEnter(to, from, next) {
		let $team = getTeam();
		window.$team = $team;
		if ($team.pg.onboarding.complete && $team.pg.onboarding.site_created) {
			next({ name: '站点列表' });
		} else if (to.query.is_redirect && $team.pg.onboarding.site_created) {
			next({ name: '站点列表' });
		} else {
			next();
		}
	},
};
</script>