<template>
  <div class="results-container">
    <h1>Live Election Results</h1>
    <div v-if="results.length > 0">
      <ul>
        <li v-for="candidate in results" :key="candidate.id">
          {{ candidate.name }}: {{ candidate.votes }} votes
        </li>
      </ul>
    </div>
    <div v-else>
      <p>Loading results...</p>
    </div>
  </div>
</template>

<script setup>
import { ref, onMounted } from 'vue';

const results = ref([]);

onMounted(() => {
  // TODO: Fetch results from backend
  results.value = [
    { id: 1, name: 'Sample Candidate A', votes: 12 },
    { id: 2, name: 'Sample Candidate B', votes: 8 }
  ];
});
</script>

<style scoped>
.results-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 50px;
}
</style>
