export type ToolbarMode = 'title' | 'views' | 'tabs' | 'disabled'; export function getToolbarMode({ isDisabled, hasTabs, hasTitle, hasViews, }: { isDisabled: boolean; hasViews: boolean; hasTabs: boolean; hasTitle: boolean; }): ToolbarMode { if (isDisabled) { return 'disabled'; } if (hasTabs) { return 'tabs'; } if (hasViews) { return 'views'; } if (hasTitle) { return 'title'; } return 'disabled'; }