<?xml version="1.0" encoding="UTF-8"?>
<templates xml:space="preserve">
    <t t-name="xeno_leave.WorkScheduleConfig">
        <div class="o_xeno_hr_page">
            <div class="o_xeno_hr_header">
                <div>
                    <h1>Working Schedules</h1>
                </div>
                <div class="o_xeno_hr_header_actions">
                    <button class="btn btn-primary" t-on-click="onNew">
                        <i class="fa fa-plus me-1"/>New
                    </button>
                </div>
            </div>

            <div t-if="state.loading" class="text-center p-5">
                <i class="fa fa-spin fa-circle-o-notch fa-2x text-muted"/>
            </div>

            <div class="o_xeno_hr_card" t-if="!state.loading">
                <table class="o_xeno_hr_table">
                    <thead>
                        <tr>
                            <th>Working Time</th>
                            <th>Hours / Week</th>
                            <th>Work Time %</th>
                            <th>Schedule Type</th>
                            <th>Actions</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr t-if="!state.rows.length">
                            <td colspan="5" class="text-center text-muted py-4">No working schedules found.</td>
                        </tr>
                        <t t-foreach="state.rows" t-as="row" t-key="row.id">
                            <tr>
                                <td class="fw-bold" t-esc="row.name"/>
                                <td t-esc="row.hoursPerWeek"/>
                                <td><t t-esc="row.workTimeRate"/>%</td>
                                <td>
                                    <span class="o_xeno_schedule_type_pill" t-esc="row.scheduleType"/>
                                </td>
                                <td>
                                    <div class="o_xeno_balance_icons">
                                        <a href="#" class="o_xeno_balance_icon" title="Edit"
                                           t-on-click.prevent="() => this.onEdit(row.id)">
                                            <i class="fa fa-pencil"/>
                                        </a>
                                    </div>
                                </td>
                            </tr>
                        </t>
                    </tbody>
                </table>
            </div>
        </div>
    </t>
</templates>
