<template>
  <widget-page disable>
    <new-task-form @save="save" @cancel="cancel" />
  </widget-page>
</template>

<script lang="ts">
import { Component, Vue } from 'vue-property-decorator'
import WidgetPage from '@/widgets/base/components/widget-page/WidgetPage.vue'
import NewTaskForm from '@/widgets/tasks/components/form/NewTaskForm.vue'
import { RouteNames } from '@/widgets/tasks/router/routeNames'

@Component({
  components: { NewTaskForm, WidgetPage },
})
export default class CreateTaskPage extends Vue {
  save() {
    return this.$router.push({
      name: RouteNames.tasks,
      query: { taskCreated: '1' },
    })
  }

  cancel() {
    return this.$router.push({ name: RouteNames.tasks })
  }
}
</script>
