import * as React from 'react'; import { AppBar, Toolbar, Typography, IconButton, Paper, Tooltip, styled } from '@mui/material'; import Grid from '@mui/material/Grid2'; import FullscreenIcon from '@mui/icons-material/Fullscreen'; import WbSunnyIcon from '@mui/icons-material/WbSunny'; import Brightness3Icon from '@mui/icons-material/Brightness3'; import EditIcon from '@mui/icons-material/Edit'; import { IUISchema } from '../UISchema'; import SearchBar from '../SearchBar/SearchBar'; import ExampleDocumentsDropdown, { IExample, } from '../ExampleDocumentsDropdown/ExampleDocumentsDropdown'; import { ITransport } from '../hooks/useTransport'; import TransportDropdown from '../components/TransportDropdown'; const StyledTitle = styled(Typography)(({ theme }) => ({ marginLeft: theme.spacing(2), })); interface IProps { uiSchema?: IUISchema; examples?: IExample[]; transportList?: ITransport[]; selectedTransport?: ITransport; searchBarUrl?: string | undefined; // eslint-disable-next-line @typescript-eslint/no-explicit-any onChangeUrl?: any; // eslint-disable-next-line @typescript-eslint/no-explicit-any onDarkModeChange?: any; // eslint-disable-next-line @typescript-eslint/no-explicit-any onSplitViewChange?: (split: boolean) => any; // eslint-disable-next-line @typescript-eslint/no-explicit-any onExampleDocumentsDropdownChange?: (example: IExample) => any; // eslint-disable-next-line @typescript-eslint/no-explicit-any onTransportAdd: (transport: ITransport) => any; // eslint-disable-next-line @typescript-eslint/no-explicit-any onTransportChange: (transport: ITransport) => any; } const ApplicationBar: React.FC = ({ uiSchema, onSplitViewChange, onDarkModeChange, examples, onExampleDocumentsDropdownChange, searchBarUrl, onChangeUrl, transportList, selectedTransport, onTransportAdd, onTransportChange, }) => { return ( {uiSchema?.appBar?.['ui:logoUrl'] && ( playground-title )} {uiSchema?.appBar?.['ui:title']} {uiSchema?.appBar?.['ui:transports'] && ( )} {uiSchema?.appBar?.['ui:input'] && ( )} {uiSchema?.appBar?.['ui:examplesDropdown'] && ( )} {uiSchema?.appBar?.['ui:edit'] && (uiSchema?.appBar?.['ui:splitView'] ? ( onSplitViewChange?.(false)}> ) : ( onSplitViewChange?.(true)}> ))} onDarkModeChange(!uiSchema?.appBar?.['ui:darkMode'])}> {uiSchema?.appBar?.['ui:darkMode'] ? : } ); }; export default ApplicationBar;