/* * Copyright (C) Contributors to the Suwayomi project * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ import { IconButton, Menu, MenuItem, FormControlLabel, Radio } from '@mui/material'; import React from 'react'; import ViewModuleIcon from '@mui/icons-material/ViewModule'; import { GridLayout, useLibraryOptionsContext } from 'components/context/LibraryOptionsContext'; // TODO: clean up this to use a FormControl, and remove dependency on name o radio button export default function SourceGridLayout() { const { options: { SourcegridLayout }, setOptions, } = useLibraryOptionsContext(); const [anchorEl, setAnchorEl] = React.useState(null); const open = Boolean(anchorEl); const handleClick = (event: any) => { setAnchorEl(event.currentTarget); }; const handleClose = () => { setAnchorEl(null); }; function setGridContextOptions(e: React.ChangeEvent, checked: boolean) { if (checked) { setOptions((prev: any) => ({ ...prev, SourcegridLayout: parseInt(e.target.name, 10) })); } } return ( <> } /> } /> } /> ); }