@payfit/unity-components
Version:
20 lines (19 loc) • 871 B
TypeScript
import { ReactNode } from 'react';
import { ActionBarActionItem, ActionBarButtonActionItem } from '../ActionBar.types.js';
interface UseActionBarStateOptions {
actions?: ActionBarActionItem[];
children?: ReactNode | ((action: ActionBarActionItem, index: number) => ReactNode);
forceExpandMobile?: boolean;
}
interface UseActionBarStateResult {
/** Whether using dynamic API (actions array + render function) */
isDynamicApi: boolean;
/** Whether there are any actions to render */
hasActions: boolean;
/** Render function for visible actions */
renderActions: () => ReactNode;
/** Actions to show in mobile overflow menu */
mobileOverflowActions: ActionBarButtonActionItem[];
}
export declare const useActionBarState: ({ actions, children, forceExpandMobile, }: UseActionBarStateOptions) => UseActionBarStateResult;
export {};