wisemapping-frontend/packages/editor/src/components/app-bar/index.tsx

35 lines
919 B
TypeScript
Raw Normal View History

import React from 'react';
2022-10-07 05:41:02 +02:00
import ActionConfig from '../../classes/action-config';
import MaterialToolbar from '@mui/material/Toolbar';
2022-10-07 07:30:46 +02:00
import MaterialAppBar from '@mui/material/AppBar';
import { ToolbarMenuItem } from '../toolbar/Toolbar';
/**
* App bar
* @param props.configurations the configurations array
* @returns toolbar wich contains an entry for each configuration in the array
*/
2022-10-07 07:30:46 +02:00
const AppBar = (props: { configurations: ActionConfig[] }) => {
return (
2022-10-07 07:30:46 +02:00
<MaterialAppBar
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>
2022-10-07 07:30:46 +02:00
</MaterialAppBar>
);
};
2022-10-07 07:30:46 +02:00
export default AppBar;