import { Button, Stack, Modal } from '@mantine/core'; import useRemoveCardFromCollections from '../../lib/mutations/useRemoveCardFromCollections'; import { notifications } from '@mantine/notifications'; import { useRouter } from 'next/navigation'; import { DANGER_OVERLAY_PROPS } from '@/styles/overlays'; interface Props { isOpen: boolean; onClose: () => void; cardId: string; collectionId: string; } export default function RemoveCardFromCollectionModal(props: Props) { const removeCardFromCollection = useRemoveCardFromCollections(); const handleRemoveCardFromCollection = () => { removeCardFromCollection.mutate( { cardId: props.cardId, collectionIds: [props.collectionId] }, { onError: () => { notifications.show({ message: 'Could not remove card from collection.', position: 'top-center', }); }, onSettled: () => { props.onClose(); }, }, ); }; return ( ); }