@nexusui/components
Version:
These are custom components specially-developed for NexusUI applications. They will make your life easier by giving you out-of-the-box implementations for various high-level UI elements that you can drop directly into your application.
58 lines (57 loc) • 1.68 kB
TypeScript
import { MenuItemProps } from '@mui/material/MenuItem';
export type IOrgItem = Omit<MenuItemProps, 'id' | 'children' | 'onClick'> & {
/**
* The id of organization.
*/
id: string;
/**
* The name of organization.
*/
name: string;
/**
* Test ID to use for unit testing
*/
'data-testid'?: string;
};
/** The props type of [[`OrganizationSelector`]]. */
export type IOrganizationSelector = Omit<MenuItemProps, 'children'> & {
/**
* The id of the currently selected organization
*/
selectedOrgId?: string;
/**
* A list of available organizations
*
* ```
* type IOrgItem = Omit<MenuItemProps, 'id' | 'children' | 'onClick'> & {
* id: string;
* name: string;
* data-testid'?: string;
* };
* ```
*/
organizations: ReadonlyArray<IOrgItem>;
/**
* Callback fired when an organization item is clicked
*/
onOrgItemChange?: (org: IOrgItem) => void;
/**
* Callback function fired whenever any MenuItem is clicked. Typically this will be used to close the menu.
*/
onMenuItemClick?: () => void;
/**
* Callback function fired when user clicks on the organization menu header.
*/
onViewOrgs?: () => void;
/**
* the operation the current organization
* @default 'View''
*/
orgActionLabel?: string;
/**
* Indicates the current organization action link opening internal or external
* @default '_blank'
*/
orgActionLinkTarget?: '_blank' | '_self';
};
export declare const OrganizationSelector: (props: IOrganizationSelector) => import("react/jsx-runtime").JSX.Element;