<template>
  <add-defunt-template>
    <template #defunt-form>
      <defunt-form
        :loading="loading"
        :validation-errors="validationErrors"
        :success="success"
        @create-defunt="handleCreateDefunt"
      />
    </template>
  </add-defunt-template>
</template>
<script setup>
import AddDefuntTemplate from "@/components/templates/Defunts/AddDefuntTemplate.vue";
import DefuntForm from "@/components/molecules/Defunts/DefuntForm.vue";
import { defineProps, defineEmits } from "vue";

defineProps({
  loading: {
    type: Boolean,
    default: false,
  },
  validationErrors: {
    type: Object,
    default: () => ({}),
  },
  success: {
    type: Boolean,
    default: false,
  },
});

const emit = defineEmits(["createDefunt"]);

const handleCreateDefunt = (data) => {
  emit("createDefunt", data);
};
</script>
