<script setup lang="ts">
const { data, status, error } = useFetch('/api/internal/current/users/?limit=100&is_readonly=0', {
  method: 'GET',
  headers: {
    'Accept': 'application/json',
  }
});

</script>

<template>
  <div>
    <!-- Causa useFetch va basically sempre in SSR gli stati diversi da success e error non appaiono mai. -->
    <div v-if="status === 'pending'">
      <p>LOADING...</p>
    </div>
    <div v-else-if="status === 'error'">
      <p>ERROR: {{ error }}</p>
    </div>
    <div v-else-if="status ==='success'">
      <p>DATA:</p>
      <p>{{ data }}</p>
    </div>
    <div v-else-if="status === 'idle'">
      <p>IDLE???</p>
    </div>
  </div>
</template>

<style scoped>

</style>