<template>
	<Dialog v-model="show" :options="{ title: '余额充值' }">
		<template #body-content>
			<div
				v-if="showMessage"
				class="mb-5 inline-flex gap-1.5 text-base text-gray-700"
			>
				<FeatherIcon class="h-4" name="info" />
				<span>
					在更改支付方式之前，请先为您的账户充值余额。
				</span>
			</div>
			<PrepaidCreditsForm
				@success="
					() => {
						show = false;
						emit('success');
					}
				"
			/>
		</template>
	</Dialog>
</template>
<script setup>
import PrepaidCreditsForm from '../BuyPrepaidCreditsForm.vue';
import { Dialog, FeatherIcon } from 'jingrow-ui';

const props = defineProps({
	showMessage: {
		type: Boolean,
		default: false
	}
});

const emit = defineEmits(['success']);
const show = defineModel();
</script>