<template>
  <div class="spectator-bar">
    <span class="spectator-bar__icon">👀</span>
    <span class="spectator-bar__text">
      观战中（{{ spectatorCount }}人）
    </span>
  </div>
</template>

<script setup lang="ts">
import { useRoomStore } from '@/stores'
import { storeToRefs } from 'pinia'

const store = useRoomStore()
const { spectatorCount } = storeToRefs(store)
</script>

<style scoped lang="scss">
.spectator-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border-light);
  font-size: 12px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.spectator-bar__icon {
  font-size: 14px;
}
</style>
