// Fusion Accounting - Account Report Buttons Bar
// Copyright (C) 2026 Nexa Systems Inc.

import { Component, useState } from "@odoo/owl";

/**
 * AccountReportButtonsBar - Renders the action buttons toolbar for reports.
 * Displays context-sensitive buttons based on the current report state.
 */
export class AccountReportButtonsBar extends Component {
    static template = "fusion_accounting.AccountReportButtonsBar";
    static props = {};

    setup() {
        this.controller = useState(this.env.controller);
    }

    //------------------------------------------------------------------------------------------------------------------
    // Buttons
    //------------------------------------------------------------------------------------------------------------------
    get barButtons() {
        const buttons = [];

        for (const button of this.controller.buttons) {
            if (button.always_show) {
                buttons.push(button);
            }
        }

        return buttons;
    }
}
