<template>
    <div class="title-box flex justify-between mb40">
        <p class="title">교재 관리</p>
        <select name="" id="">
            <option value="">A 교재</option>
        </select>
    </div>
    <div class="board-wrap">
        <label for="" class="title2">단원</label>
        <div class="table-pagination flex mt10">
            <button class="selected-btn">1</button>
            <button>2</button>
            <button>3</button>
        </div>
        <hr>
        <div class="bookmanage-btn mb20 flex justify-between align-center" @click="goToPage('TextList')">
            <label for="" class="title1">지문</label>
            <div class="flex align-center " style="gap: 10px;">
                <p>00개</p>
                <button><img src="../../../resources/img/btn33_101t_normal.png" alt=""></button>
            </div>
        </div>
        <div class="bookmanage-btn mb20 flex justify-between align-center" @click="goToPage('QuestionList')">
            <label for="" class="title1">문제</label>
            <div class="flex align-center " style="gap: 10px;">
                <p>00개</p>
                <button><img src="../../../resources/img/btn33_101t_normal.png" alt=""></button>
            </div>
        </div>
        <div class="bookmanage-btn mb20 flex justify-between align-center" @click="goToPage('VocaList')">
            <label for="" class="title1">단어</label>
            <div class="flex align-center " style="gap: 10px;">
                <p>00개</p>
                <button><img src="../../../resources/img/btn33_101t_normal.png" alt=""></button>
            </div>
        </div>
        <div class="bookmanage-btn mb20 flex justify-between align-center" @click="goToPage('ExamList')">
            <label for="" class="title1">중간 평가</label>
            <div class="flex align-center " style="gap: 10px;">
                <p>00개</p>
                <button><img src="../../../resources/img/btn33_101t_normal.png" alt=""></button>
            </div>
        </div>
        <div class="bookmanage-btn flex justify-between align-center" @click="goToPage('ExamList')">
            <label for="" class="title1">최종 평가</label>
            <div class="flex align-center " style="gap: 10px;">
                <p>00개</p>
                <button><img src="../../../resources/img/btn33_101t_normal.png" alt=""></button>
            </div>
        </div>
    </div>
    <div class="flex justify-end mt30">
        <button type="button" title="" class="new-btn" @click="showConfirm('delete')">
            삭제
        </button>
    </div>
</template>

<script>
import SvgIcon from '@jamescoyle/vue-icon';
import { mdiMagnify, mdilArrowRight } from '@mdi/js';
import ProgressBar from '../../component/ProgressBar.vue';


export default {
    data() {
        return {
            mdiMagnify: mdiMagnify,
            mdilArrowRight: mdilArrowRight,
            timer: "00:00",
            progress: 20
        }
    },
    methods: {
        goToPage(page) {
            this.$router.push({ name: page });
        },
        increaseProgress() {
            if (this.progress < 100) {
                this.progress += 10;
            }
        },
        showConfirm(type) {
            let message = '';
            if (type === 'delete') {
                message = '삭제하시겠습니까?';
            } else if (type === 'reset') {
                message = '초기화하시겠습니까?';
            } else if (type === 'save') {
                message = '등록하시겠습니까?';
            }

            if (confirm(message)) {
                this.goBack();
            }
        },
    },
    watch: {

    },
    computed: {

    },
    components: {
        SvgIcon,
        ProgressBar
    },
    mounted() {
        console.log('Main2 mounted');
    }
}
</script>