<template>
  <div class="flex h-full w-full relative">
    <div class="w-[15%] flex flex-col relative">
      <!-- Asset Categories -->
      <a class="relative p-2.5 hover:cursor-pointer" :class="{ 'bg-cyan/80': selectedCategory === 'tiles' }" @click="() => (selectedCategory = 'tiles')">
        <span>Tiles</span>
        <div class="absolute left-0 bottom-0 w-full h-[1px] bg-cyan-200"></div>
      </a>
      <a class="relative p-2.5 hover:cursor-pointer" :class="{ 'bg-cyan/80': selectedCategory === 'objects' }" @click="() => (selectedCategory = 'objects')">
        <span>Objects</span>
        <div class="absolute left-0 bottom-0 w-full h-[1px] bg-cyan-200"></div>
      </a>
      <a class="relative p-2.5 hover:cursor-pointer">
        <span>Items</span>
        <div class="absolute left-0 bottom-0 w-full h-[1px] bg-cyan-200"></div>
      </a>
      <a class="relative p-2.5 hover:cursor-pointer">
        <span>NPC's</span>
        <div class="absolute left-0 bottom-0 w-full h-[1px] bg-cyan-200"></div>
      </a>
      <a class="relative p-2.5 hover:cursor-pointer">
        <span>Characters</span>
        <div class="absolute left-0 bottom-0 w-full h-[1px] bg-cyan-200"></div>
      </a>
      <a class="relative p-2.5 hover:cursor-pointer">
        <span>Mounts</span>
        <div class="absolute left-0 bottom-0 w-full h-[1px] bg-cyan-200"></div>
      </a>
      <a class="relative p-2.5 hover:cursor-pointer">
        <span>Pets</span>
        <div class="absolute left-0 bottom-0 w-full h-[1px] bg-cyan-200"></div>
      </a>
      <a class="relative p-2.5 hover:cursor-pointer" :class="{ 'bg-cyan/80': selectedCategory === 'sprite' }" @click="() => (selectedCategory = 'sprite')">
        <span>Sprites</span>
        <div class="absolute left-0 bottom-0 w-full h-[1px] bg-cyan-200"></div>
      </a>
    </div>
    <div class="absolute w-[1px] bg-cyan-200 h-full top-0 left-[15%]"></div>

    <!-- Assets list -->
    <div class="overflow-auto h-full w-[35%] flex flex-col relative">
      <TileList v-if="selectedCategory === 'tiles'" />
      <ObjectList v-if="selectedCategory === 'objects'" />
    </div>

    <div class="absolute w-[1px] bg-cyan-200 h-full top-0 left-1/2"></div>

    <!-- Asset details -->
    <div class="flex w-1/2 after:hidden flex-col relative overflow-auto">
      <TileDetails v-if="selectedCategory === 'tiles' && assetManagerStore.selectedTile" />
      <ObjectDetails v-if="selectedCategory === 'objects' && assetManagerStore.selectedObject" />
    </div>
  </div>
</template>

<script setup lang="ts">
import { ref } from 'vue'
import TileList from '@/components/utilities/assetManager/partials/TileList.vue'
import TileDetails from '@/components/utilities/assetManager/partials/TileDetails.vue'
import ObjectList from '@/components/utilities/assetManager/partials/ObjectList.vue'
import ObjectDetails from '@/components/utilities/assetManager/partials/ObjectDetails.vue'
import { useAssetManagerStore } from '@/stores/assetManager'

const assetManagerStore = useAssetManagerStore()
const selectedCategory = ref('tiles')
</script>
