<template>
    <div class="row m-b-10 parentContainer">
        <div class="col">
            <div class="row p-b-10 b-b b-grey">
                <div class="col-2">{{ item.imported_date }}</div>
                <div class="col-2">                        
                    <button class="btn btn-xs btn-outline-success b-rad-none m-r-5" @click="downloadInvoiceMapped(item.imported_date)">
                            Download Invoices Mapped
                    </button>
                </div>
            </div>
        </div>
    </div>
</template>

<script>
    import componentHandler from '../../../general/mixins/componentHandler';
    export default {
        props: {
            stage: {
                type: Number,
                default: 0
            },
            section:{
                type: String,
                required: true
            },
        },
        methods: {
            downloadInvoiceMapped(importedDate) {
                var arrDateTime = importedDate.split(" ");
                const fileName = 'InvoiceMapped';
                
                window.open(this.route('importedInvoiceMapped.export')+'?date='+arrDateTime[0]+'&time='+arrDateTime[1]+'&fileName='+fileName, '_blank');
            },
        },
        mixins: [componentHandler]
    }
</script>
