<template>
    <ie-page fix-height :safe-area-inset-bottom="false">
        <ie-navbar title="生涯测评结果"/>
        <ie-auto-resizer>
            <ie-tabs-swiper v-model="current" :list="tabs" :scrollable="false">
                <template #holland>
                    <holland-list />
                </template>
                <template #mbti>
                    <mbti-list/>
                </template>
            </ie-tabs-swiper>
        </ie-auto-resizer>
    </ie-page>
</template>

<script setup lang="ts">
import _ from "lodash";
import {SwiperTabItem} from "@/types";
import {useTransferPage} from "@/hooks/useTransferPage";
import HollandList from "@/pagesOther/pages/test-center/list/components/holland-list.vue";
import MbtiList from "@/pagesOther/pages/test-center/list/components/mbti-list.vue";

const {prevData} = useTransferPage()
const current = ref(0);
const tabs = ref<SwiperTabItem[]>([
    {
        name: '专业兴趣(HOLLAND)',
        slot: 'holland'
    },
    {
        name: '职业性格(MBTI)',
        slot: 'mbti'
    }
]);

onMounted(() => {
    const matchIdx = _.findIndex(tabs.value, t => t.slot == prevData.value.type)
    current.value = matchIdx > -1 ? matchIdx : 0
})
</script>

<style lang="scss">

</style>
