<?xml version="1.0" encoding="UTF-8"?>
<templates xml:space="preserve">
    <t t-name="xeno_leave.LeaveImportResultDialog">
        <Dialog title="props.title" size="'md'">
            <div class="o_xeno_leave_import_result">
                <p class="mb-2">
                    <span t-attf-class="badge {{ props.imported ? 'text-bg-success' : 'text-bg-secondary' }} me-2"
                          t-esc="props.imported"/>
                    <t t-esc="props.imported === 1 ? props.itemLabel + ' created.' : props.itemLabel + 's created.'"/>
                </p>
                <p class="mb-2" t-if="props.updated">
                    <span class="badge text-bg-info me-2" t-esc="props.updated"/>
                    <t t-esc="props.updated === 1 ? props.itemLabel + ' updated.' : props.itemLabel + 's updated.'"/>
                </p>
                <div t-if="props.errors.length">
                    <p class="mb-1 fw-bold text-danger" t-esc="props.errors.length + ' row(s) skipped:'"/>
                    <ul class="o_xeno_leave_import_errors"
                        style="max-height: 260px; overflow-y: auto; font-size: 0.85rem; padding-left: 1.1rem;">
                        <t t-foreach="props.errors" t-as="err" t-key="err_index">
                            <li t-esc="err"/>
                        </t>
                    </ul>
                </div>
                <div class="d-flex justify-content-end mt-3">
                    <button class="btn btn-primary" t-on-click="() => props.close()">Close</button>
                </div>
            </div>
        </Dialog>
    </t>
</templates>
