feat(MoveToShelf): move selected books to shelf

This commit is contained in:
0ry5 2024-09-30 21:32:24 +02:00
parent 65e9aa2e0b
commit c03aa30cfd
12 changed files with 331 additions and 69 deletions
frontend/src/shared/components/modals

View file

@ -6,8 +6,9 @@ import { CheckoutBookModal } from "./CheckoutModal";
import { ScannerModal } from "./ScannerModal";
import { DeleteBookModal } from "./DeleteBookModal";
import { ModalContextType } from "../../../App";
import { MoveShelfModal } from "./MoveShelfModal";
const { auth, book, checkout, scanner, del } = modalTypes;
const { auth, book, checkout, scanner, del, moveShelf } = modalTypes;
export const ModalSelector = ({
activeModal,
@ -48,7 +49,15 @@ export const ModalSelector = ({
<DeleteBookModal
open={activeModal?.type === del}
onClose={activeModal?.type === del ? activeModal.onClose : setActiveModal}
uuid={activeModal?.type === checkout ? activeModal.uuid : ""}
uuid={activeModal?.type === del ? activeModal.uuid : ""}
title={activeModal?.type === del ? activeModal.title : ""}
/>
<MoveShelfModal
books={activeModal?.type === moveShelf ? activeModal.books : []}
open={activeModal?.type === moveShelf}
onClose={
activeModal?.type === moveShelf ? activeModal.onClose : setActiveModal
}
/>
</>
);