2022-10-05 23:54:23 +02:00
|
|
|
import React from 'react';
|
2022-10-07 05:41:02 +02:00
|
|
|
import ActionConfig from '../../classes/action-config';
|
2022-10-05 23:54:23 +02:00
|
|
|
import MaterialToolbar from '@mui/material/Toolbar';
|
|
|
|
import AppBar from '@mui/material/AppBar';
|
|
|
|
import { ToolbarMenuItem } from './Toolbar';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* App bar
|
|
|
|
* @param props.configurations the configurations array
|
|
|
|
* @returns toolbar wich contains an entry for each configuration in the array
|
|
|
|
*/
|
2022-10-07 05:30:27 +02:00
|
|
|
const Menubar = (props: { configurations: ActionConfig[] }) => {
|
2022-10-05 23:54:23 +02:00
|
|
|
return (
|
|
|
|
<AppBar
|
|
|
|
role="menubar"
|
|
|
|
position="absolute"
|
|
|
|
color="default"
|
|
|
|
className="material-menubar"
|
|
|
|
sx={{
|
|
|
|
'& MuiButtonBase-root': {
|
|
|
|
marginX: '1rem',
|
|
|
|
},
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
<MaterialToolbar>
|
|
|
|
{props.configurations.map((c, i) => {
|
|
|
|
return <ToolbarMenuItem key={i} configuration={c} />;
|
|
|
|
})}
|
|
|
|
</MaterialToolbar>
|
|
|
|
</AppBar>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default Menubar;
|