<template>
  <div>
    {{server}}
  </div>
  <button @click="remove">Remove</button>/
</template>

<script setup>
import {ref} from "vue";

// defined constants
const props = defineProps({
  server: {
    type: Object,
    required: true
  }
})
const emit = defineEmits(['remove'])

// defined methods
async function remove(){
  const response = await fetch("/api/server/servers/", {
    method: 'DELETE'
  })
  if (response.ok) {
    emit('remove')
  } else {
    console.error("Failed to fetch servers:", response.statusText)
  }
}

onMounted(() => {

})
</script>

<style scoped>

</style>