import * as React from 'react';
import { PopoverProps } from '../Popover';
import { MenuListProps } from '../MenuList';
import { PaperProps } from '../Paper';
import { StandardProps } from '..';
import { TransitionHandlerProps, TransitionProps } from '../transitions/transition';
export interface MenuProps
extends StandardProps<PopoverProps & Partial<TransitionHandlerProps>, MenuClassKey> {
anchorEl?: PopoverProps['anchorEl'];
autoFocus?: boolean;
children?: React.ReactNode;
disableAutoFocusItem?: boolean;
MenuListProps?: Partial<MenuListProps>;
onClose?: PopoverProps['onClose'];
onEnter?: PopoverProps['onEnter'];
onEntered?: PopoverProps['onEntered'];
onEntering?: PopoverProps['onEntering'];
onExit?: PopoverProps['onExit'];
onExited?: PopoverProps['onExited'];
onExiting?: PopoverProps['onExiting'];
open: boolean;
PopoverClasses?: PopoverProps['classes'];
transitionDuration?: TransitionProps['timeout'] | 'auto';
variant?: 'menu' | 'selectedMenu';
}
export type MenuClassKey = 'paper' | 'list';
export default function Menu(props: MenuProps): JSX.Element;
{mainInformation.userTeam[0].map((value) => (
<MenuItem onClick={() => closeMenuPerTeam({
ID: task.ID,
ROUTE_USER: value,
})}>
{value} {task.ID} // Никуда не передавая, просто отображаем значение.
<MenuItem onClick={ onClick(task, value) }>
function ComponentName ({mainInformation, tasksData}) {
const closeMenuPerTeam = () => {
setActionRequest(data);
}
return (
<React.Fragment>
<div>
...
</div>
</React.Fragment>
);
const tasksData = handleActions({
[setActionRequest.toString()]: (state, { payload } => {
if (Array.isArray(state.infoTask)) {
const id = payload.ID;
const tasks = state.infoTask.map((task) => {
let t = task;
if (task.ID == id) t.ROUTE_USER = payload.ROUTE_USER;
return t;
});
return tasks;
}
return state;
},
null,
);
const tasksData = handleActions({
[setActionRequest.toString()]: (state, action) => ({
...state,
ROUTE: action.payload,
}),
},
null,
);
const tasksData = handleActions({
[setActionRequest.toString()]: (state, action) => ({
let newState = {...state};
state.map() {
if ( // что писать дальше?
}),
},
null,
);