import { useCallback } from 'react'; import { PDFDownloadLink, PDFViewer } from '@react-pdf/renderer'; // @mui import Box from '@mui/material/Box'; import Stack from '@mui/material/Stack'; import Button from '@mui/material/Button'; import Dialog from '@mui/material/Dialog'; import Tooltip from '@mui/material/Tooltip'; import MenuItem from '@mui/material/MenuItem'; import TextField from '@mui/material/TextField'; import IconButton from '@mui/material/IconButton'; import DialogActions from '@mui/material/DialogActions'; import CircularProgress from '@mui/material/CircularProgress'; // routes import { paths } from 'src/routes/paths'; import { useRouter } from 'src/routes/hooks'; // hooks import { useBoolean } from 'src/hooks/use-boolean'; // types import { Invoice } from 'src/schemas'; // components import Iconify from 'src/components/iconify'; import InvoicePDF from './invoice-pdf'; // ---------------------------------------------------------------------- type Props = { invoice: Invoice; currentStatus: string; onChangeStatus: (event: React.ChangeEvent) => void; statusOptions: { value: string; label: string; }[]; }; export default function InvoiceToolbar({ invoice, currentStatus, statusOptions, onChangeStatus, }: Props) { const router = useRouter(); const view = useBoolean(); const handleEdit = useCallback(() => { router.push(paths.dashboard.invoice.edit(invoice.id)); }, [invoice.id, router]); return ( <> } fileName={invoice.invoiceNumber} style={{ textDecoration: 'none' }} > {({ loading }) => ( {loading ? ( ) : ( )} )} {/* */} {statusOptions.map((option) => ( {option.label} ))} ); }