2023-07-08 14:54:26 +00:00
|
|
|
import Brightness7Icon from "@mui/icons-material/Brightness7";
|
|
|
|
import DarkModeIcon from "@mui/icons-material/DarkMode";
|
|
|
|
import { IconButton, Tooltip } from "@mui/material";
|
2023-08-09 06:28:37 +00:00
|
|
|
import { useDarkTheme } from "../hooks/context_providers/DarkThemeProvider";
|
2023-07-08 14:54:26 +00:00
|
|
|
|
|
|
|
export function DarkThemeButton(): React.ReactElement {
|
|
|
|
const darkTheme = useDarkTheme();
|
|
|
|
|
|
|
|
return (
|
|
|
|
<Tooltip title="Activer / désactiver le mode sombre">
|
|
|
|
<IconButton
|
|
|
|
onClick={() => darkTheme.setEnabled(!darkTheme.enabled)}
|
|
|
|
style={{ color: "inherit" }}
|
|
|
|
>
|
|
|
|
{!darkTheme.enabled ? <DarkModeIcon /> : <Brightness7Icon />}
|
|
|
|
</IconButton>
|
|
|
|
</Tooltip>
|
|
|
|
);
|
|
|
|
}
|