<template>
    <div class="bgmr vh100 over-y-auto">
        <section class="bg-fff px-20 py-10 analysis-tabs">
            <div class="flex-items-center gap-16">
                <div
                    v-for="item in tabs"
                    :key="item.value"
                    class="px-12 py-8 round-6 font-bold pointer"
                    :class="activeTab === item.value ? 'bg-main color-fff' : 'color-000'"
                    @click="activeTab = item.value"
                >
                    {{ item.label }}
                </div>
            </div>
        </section>
        <div class="p-16">
            <component :is="currentComponent" />
        </div>
    </div>
</template>

<script setup lang="ts">
import { computed, ref } from 'vue';
import Tab1 from './components/Team/Tab1.vue';
import Tab2 from './components/Team/Tab2.vue';
import Tab3 from './components/Team/Tab3.vue';

const activeTab = ref('tab1');
const tabs = [
    { label: '数据洞察', value: 'tab1', component: Tab1 },
    { label: '创作分析', value: 'tab2', component: Tab2 },
    { label: '任务分析', value: 'tab3', component: Tab3 },
];

const currentComponent = computed(() => tabs.find((item) => item.value === activeTab.value)?.component);
</script>

<style scoped lang="scss">
.analysis-tabs {
    border-bottom: 1px solid #dfe7f2;
}
</style>
