<template>
  <div class="creation-tabs">
    <div
      class="tab"
      :class="{ active: active === 'text-to-video' }"
      @click="navigate('/text-to-video/create')"
    >{{ t('home.textToVideo') }}</div>
    <div
      class="tab"
      :class="{ active: active === 'image-to-video' }"
      @click="navigate('/image-to-video/create')"
    >{{ t('home.imageToVideo') }}</div>
    <div
      class="tab"
      :class="{ active: active === 'storyboard-video' }"
      @click="navigate('/storyboard-video/create')"
    >{{ t('home.storyboardVideo') }}</div>
    <div
      class="tab"
      :class="{ active: active === 'novel-comic' }"
      @click="navigate('/novel-comic/create')"
    >小说漫剧</div>
  </div>
</template>

<script setup>
import { useRouter } from 'vue-router'
import { useI18n } from 'vue-i18n'

defineProps({
  active: {
    type: String,
    required: true,
    validator: (v) => ['text-to-video', 'image-to-video', 'storyboard-video', 'novel-comic'].includes(v)
  }
})

const router = useRouter()
const { t } = useI18n()

const navigate = (path) => {
  router.push(path)
}
</script>

<style scoped>
.creation-tabs {
  display: flex;
  gap: var(--space-2);
  padding: 0;
  flex-shrink: 0;
}

.tab {
  width: 155px;
  height: 44px;
  padding: 0;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: var(--transition-all);
  color: var(--text-tertiary);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.tab.active {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: transparent;
}

.tab:hover:not(.active) {
  background: rgba(49, 51, 56, 0.5);
  color: var(--text-primary);
  border-color: transparent;
}
</style>
