MenuItem.tsx 598 B

1234567891011121314151617181920212223242526
  1. import { MenuAction, MenuState } from '../modules/MainMenu';
  2. export interface MenuItemRenderContext {
  3. path: string;
  4. state: MenuState;
  5. slim: boolean;
  6. dispatch(action: MenuAction);
  7. navigate(url: string): Promise<void>;
  8. }
  9. export interface MenuItemDefinition {
  10. name: string;
  11. label: string;
  12. iconName: string | null;
  13. classNames?: string;
  14. render(context: MenuItemRenderContext): React.ReactFragment;
  15. }
  16. export interface MenuItemProps<T> {
  17. path: string;
  18. slim: boolean;
  19. state: MenuState;
  20. item: T;
  21. dispatch(action: MenuAction): void;
  22. navigate(url: string): Promise<void>;
  23. }