import { Close, UnfoldLess, UnfoldMore } from "@mui/icons-material"; import { Box, IconButton, Modal, Tooltip, Typography, useTheme } from "@mui/material"; import { FC, ReactNode } from "react"; import { useSettings } from "../../contexts/SettingsContext"; import { hexToRgba } from "../../lib/utils/color"; interface FloatingDialog { actionButtons?: ReactNode; body: ReactNode; bottomBar?: ReactNode; close: () => void; maximisedState: boolean; openButton: ReactNode; openState: boolean; setMaximisedState: (state: boolean) => void; title: string; sx?: any; } export const FloatingDialog: FC = ({ actionButtons, body, bottomBar, close, maximisedState, openButton, openState, setMaximisedState, title, sx, }) => { // contexts const { settings } = useSettings(); const theme = useTheme(); const { r, g, b, a } = hexToRgba(theme.palette.background.paper); return ( <> {openButton} {title} {actionButtons} { setMaximisedState(!maximisedState); }} sx={{ mr: 1, }} > {maximisedState ? : } {body} {bottomBar} ); };