<!-- Page de détails d'une zone de résidence -->
<template>
  <main>
    <FormParametersResidenceArea :id="id" v-if="!fetchState.pending"></FormParametersResidenceArea>
  </main>
</template>

<script lang="ts">
import {defineComponent, useContext} from '@nuxtjs/composition-api'
import {useDataUtils} from "~/composables/data/useDataUtils";
import {ResidenceArea} from "~/models/Billing/ResidenceArea";

export default defineComponent({
  name: 'EditFormParametersResidenceArea',
  setup () {
    const {$dataProvider, route} = useContext()
    const {getItemToEdit} = useDataUtils($dataProvider)
    const id = parseInt(route.value.params.id)
    const {fetchState} = getItemToEdit(id, ResidenceArea)
    return {
      id,
      fetchState
    }
  }
})
</script>
