<!-- Page de détails d'une zone de résidence -->
<template>
  <main>
    <v-skeleton-loader
      v-if="loading"
      type="text"
    />
    <FormParametersResidenceArea :id="item.id" v-else></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: 'NewFormParametersResidenceArea',
  setup () {
    const {$dataProvider, store} = useContext()
    const {createItem} = useDataUtils($dataProvider)
    const {create, loading, item} = createItem(store, ResidenceArea)

    if(process.client){
      const itemToCreate: ResidenceArea = new ResidenceArea()
      create(itemToCreate)
    }

    return {
      loading,
      item
    }
  }
})
</script>
