Represents a menu option.

interface IMenuGroup<T extends any = any> {
    bold?: boolean;
    disabled?: boolean;
    getRoles?: (payload: T) => string[] | (payload: T) => Promise<string[]>;
    icon?: any;
    isBold?: (payload: T) => boolean | (payload: T) => Promise<boolean>;
    isDisabled?: (payload: T) => boolean | (payload: T) => Promise<boolean>;
    isVisible?: (payload: T) => boolean | (payload: T) => Promise<boolean>;
    label: string;
    lifted?: boolean;
    name?: string;
    options?: IMenuGroup<T>[];
    roles?: string[];
    visible?: boolean;
}

Type Parameters

  • T extends any = any

    The type of the payload for dynamic properties.

Hierarchy (View Summary)

Properties

bold?: boolean
disabled?: boolean
getRoles?: (payload: T) => string[] | (payload: T) => Promise<string[]>
icon?: any

Represents a variable called 'icon' which is a React component type that can accept any props.

isBold?: (payload: T) => boolean | (payload: T) => Promise<boolean>

Determines whether the payload is in bold format.

T - The type of the payload.

The payload to check.

  • Returns true if the payload is in bold format, otherwise returns false or a promise that resolves to true or false.
isDisabled?: (payload: T) => boolean | (payload: T) => Promise<boolean>

Determines if the payload is disabled.

The payload to check for disablement.

  • Returns true if the payload is disabled, otherwise false.

The payload to check for disablement.

  • Returns true if the payload is disabled, otherwise false.

The payload to check for disablement.

  • Returns a promise that resolves to true if the payload is disabled, otherwise false.
isVisible?: (payload: T) => boolean | (payload: T) => Promise<boolean>

Determines the visibility of a payload based on specified conditions.

A function that takes a payload as a parameter and returns a boolean value or a Promise that resolves to a boolean value indicating visibility.

  • If the isVisible function returns a boolean value, this function will return the evaluated value. If the isVisible function returns a Promise , this function will return a Promise that resolves to a boolean value.
label: string
lifted?: boolean
name?: string
options?: IMenuGroup<T>[]
roles?: string[]
visible?: boolean