<template>
  <div>
    <ul>
      <li v-for="employee in employees" :key="employee.id" @click="selectEmployee(employee)">
        {{ employee.first_name }} {{ employee.last_name }}
      </li>
    </ul>
  </div>
</template>

<script setup>
import { defineEmits } from 'vue';

const props = defineProps({
  employees: {
    type: Array,
    required: true
  }
});

const emit = defineEmits(['select']);

const selectEmployee = (employee) => {
  emit('select', employee);
};
</script>
