/* * 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 Download from '@mui/icons-material/Download'; import MoreHoriz from '@mui/icons-material/MoreHoriz'; import { Fab, ListItemIcon, ListItemText, Menu, MenuItem, } from '@mui/material'; import { Box } from '@mui/system'; import { pluralize } from 'components/util/helpers'; import React, { useRef, useState } from 'react'; interface SelectionFABProps{ selectedChapters: IChapter[] onAction: (action: 'download') => void } const SelectionFAB: React.FC = (props) => { const { selectedChapters, onAction } = props; const count = selectedChapters.length; const anchorEl = useRef(); const [open, setOpen] = useState(false); const handleClose = () => setOpen(false); return ( setOpen(true)} > {`${count} ${pluralize(count, 'chapter')}`} { onAction('download'); handleClose(); }} > Download selected {/* { onClearSelection(); handleClose(); }}> ClearSelection */} ); }; export default SelectionFAB;