<template>
    <div class="row no-margin">
        <div class="col">
            <div class="row no-margin p-t-10 p-b-10">
                <div class="col p-l-0">
                    <div class="row">
                        <div class="col">
                            <div class="bold">
                                <span class="v-align-middle">#{{this.order.marking}} </span>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col">
                            <div class="fs-10 muted">Created: <span class="text-success semi-bold">{{this.order.date}}</span></div>
                        </div>
                    </div>
                </div>
                <div class="col-auto p-r-0">
                    <div class="row">
                        <div class="col"></div>
                        <div class="col-auto">
                            <span class="fs-11 muted">Status: </span>
                            <span class="text-capitalize bold text-danger fs-11" v-if="!this.order.complete">{{this.order.current_step.details.initial_name}}</span>
                            <span class="text-capitalize bold text-success fs-11" v-if="this.order.complete">Complete</span>
                        </div>
                    </div>
                    <div class="row" >
                        <div class="col text-right muted">
                            <span class="fs-11 inline v-align-middle" v-if="!this.order.complete">{{this.order.current_step.details.description}}</span>
                            <span class="fs-11 inline v-align-middle" v-if="this.order.complete">Order has been delivered</span>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</template>

<script>
    export default {
        props: {
            'data': {
                required: true
            }
        },
        data() {
            return {
                order: this.data,
            }
        },
        watch: {
            'data': function() {
                this.order = this.data;
            }
        },
    }
</script>