import { alpha, Box, Typography } from '@mui/material'; import { ipcRenderer } from 'electron'; import React from 'react'; import CloseIcon from '@mui/icons-material/Close'; import AspectRatioIcon from '@mui/icons-material/AspectRatio'; import RemoveIcon from '@mui/icons-material/Remove'; const ipc = require('electron').ipcRenderer; const AppbarButton = ({ onClick, bgcolor, children }: any) => ( {children} ); const WindowAppbar = () => { const handleWindowToggle = () => ipc.send('window-toggle'); const handleMinimize = () => ipc.send('window-minimize'); const handleClose = () => ipc.send('window-close'); const buttons = [ { onClick: handleClose, bgcolor: 'error.main', icon: }, { onClick: handleMinimize, bgcolor: 'warning.main', icon: }, { onClick: handleWindowToggle, bgcolor: 'success.main', icon: } ]; return ( theme.zIndex.appBar }}> {buttons.map((button, index) => ( {button.icon} ))} alpha(theme.palette.text.primary, 0.1) }}> Ultima ); }; export default WindowAppbar;