// Fusion Accounting - Account Report Cog Menu
// Copyright (C) 2026 Nexa Systems Inc.

import {Component, useState} from "@odoo/owl";
import { Dropdown } from "@web/core/dropdown/dropdown";
import { DropdownItem } from "@web/core/dropdown/dropdown_item";

/**
 * AccountReportCogMenu - Settings dropdown menu for report configuration.
 * Provides access to report variants, export options, and other settings.
 */
export class AccountReportCogMenu extends Component {
    static template = "fusion_accounting.AccountReportCogMenu";
    static components = {Dropdown, DropdownItem};
    static props = {};

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

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

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

        return buttons;
    }
}
