<template>
    <div class="row m-b-10 parentContainer">
        <div class="col">
            <div class="row align-items-center">
                <div class="col p-t-5 p-b-5">
                    <div class="col text-center">
                        <div class="row m-b-20">
                            <div class="col">
                                <h5 class="all-caps">Delete address</h5>
                                <div class="fs-11">Are you sure you want to delete? This action is undoable.</div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col p-r-5">
                                <div data-dismiss="modal" class="btn btn-sm btn-default bg-master-lighter btn-block b-rad-none">Cancel</div>
                            </div>
                            <div class="col p-l-5">
                                <div data-dismiss="modal" class="btn btn-sm btn-success btn-block b-rad-none" @click="deleteAddress()">Delete</div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</template>

<script>
    import componentHandler from '../../../general/mixins/componentHandler';
    import staticFormHandler from '../../../general/mixins/staticFormHandler'
    export default {
        props: {
            'address_id' : {
                type: Number,
                required:true,
            },
        },
        data(){
            return {
                parameters:null,
                isLoading: false,
            }
        },
        methods: {
            deleteAddress(){
                this.submit(route('api.address.delete',this.address_id), 'delete', this.section, true, true);
            },
            successHandler(){
                this.$store.dispatch('reloadList', {'name': "addresslist"});
            },
        },
        mixins: [componentHandler, staticFormHandler]
    }
</script>
