<template>
  <wrapper
    fill
    margin
    padding
    background
  >
    <schedule
      class="l-flex__auto"
      :schedule="scheduleId"
      editable
      @submit="onBack"
      @back="onBack"
    />
  </wrapper>
</template>

<script>
export default {
  name: 'ScheduleDesginer',
  props: {
    redirect: {
      type: String,
      default: ''
    }
  },
  computed: {
    scheduleId () {
      return this.$route.params.id
    }
  },
  methods: {
    onBack () {
      if (this.redirect) {
        this.$router.replace({
          name: this.redirect
        })
      }
    }
  }
}
</script>
