<template>
	<Dialog
		:options="{
			title: $t('Settings')
		}"
		v-model="show"
	>
		<template #body-content>
			<div class="mt-8 flex flex-col gap-4">
				<Switch
					v-model="enforce2FA"
					:label="$t('Enforce Two-Factor Authentication')"
					:description="$t('Require all team members to enable two-factor authentication')"
				/>
			</div>
		</template>
	</Dialog>
</template>

<script>
import { Switch } from 'jingrow-ui';

export default {
	data() {
		return {
			show: true
		};
	},
	components: { Switch },
	computed: {
		enforce2FA: {
			get() {
				return Boolean(this.$team?.pg.enforce_2fa);
			},
			set(value) {
				this.$team.setValue.submit({ enforce_2fa: value });
			}
		}
	}
};
</script>