<template>
    <c-card>
        <div class="row">

            <div class="col-2">
                <router-link :to="{name: $appRoute.taskAdd.name}">Add</router-link>

                <template v-if="isEdit">
                    <br>
                    <router-link :to="{name: $appRoute.taskEdit.name, params: {id: 123}}">Edit</router-link>
                    <br>
                    <router-link :to="{name: $appRoute.taskRates.name, params: {id: 123}}">Rates</router-link>
                </template>
            </div>

            <div class="col-10">
                <router-view></router-view>
            </div>

        </div>
    </c-card>
</template>

<script>
    import CCard from "../../../components/Card";
    export default {
        name: "Editor",
        components: {
            CCard
        },
        props: {
            isEdit: {
                type: Boolean,
                default: false,
                required: true
            }
        },
        watch: {
            $route(route) {
                console.log('[Editor]', this.isEdit);
            }
        }
    }
</script>
