import { defineComponent } from "vue";
import styles from "./index.module.less";
import icon_title from '../../evaluat-model/evaluat-audio/icon_title.svg'
import icon_cancel from '../../evaluat-model/evaluat-audio/icon_cancel.svg'
import icon_confirm from '../../evaluat-model/evaluat-audio/icon_confirm.svg'
import state, { IPlatform } from "/src/state";

export default defineComponent({
	name: "evaluat-audio",
	props: {
		tip: {
			type: String,
			default: () => ''
		}
	},
	emits: ["close"],
	setup(props, { emit }) {
		return () => (
			<div class={[styles.fraction, state.platform === IPlatform.PC && styles.pcFraction]}>
				{ state.platform === IPlatform.PC && <div class={'top_drag'}></div> }
				<div class={styles.title}>
					<img src={icon_title} />
				</div>
				<div class={styles.tip}>{props.tip}</div>
				<div class={styles.btns}>
					<img src={icon_cancel} class={styles.btn} onClick={() => emit("close")} />
					<img src={icon_confirm} class={styles.btn} onClick={() => emit("close", true)} />
				</div>
			</div>
		);
	},
});
