import { defineComponent } from "vue";
import styles from "./index.module.less";
import state from "/src/state";
import icon_title from './icon_title.svg'
import icon_cancel from './icon_cancel.svg'
import icon_confirm from './icon_confirm.svg'

export default defineComponent({
	name: "abnormal-pop",
	props:{
		contents: {
			type: String,
			default: () => ''
		},
		confirmBtn: {
			type: Boolean,
			default: false
		}
    },
	emits: ["close"],
	setup(props, { emit }) {
		return () => (
			<div class={styles.fraction}>
				<div class={styles.title}>
					<img src={icon_title} />
				</div>
				<div class={styles.tip}>{props.contents}</div>
				{
					props.confirmBtn && 
					<div class={styles.btns}>
						<img src={icon_confirm} class={styles.btn} onClick={() => emit("close", true)} />
					</div>					
				}
			</div>
		);
	},
});
