import React from 'react'; import toast from 'react-hot-toast'; import Modal from 'components/Modal'; import { useDispatch } from 'react-redux'; import { removeCollection } from 'providers/ReduxStore/slices/collections/actions'; const RemoveCollection = ({ onClose, collection }) => { const dispatch = useDispatch(); const onConfirm = () => { dispatch(removeCollection(collection.uid)) .then(() => { toast.success('Collection closed'); onClose(); }) .catch(() => toast.error('An error occurred while closing the collection')); }; return ( Are you sure you want to close collection {collection.name} from Bruno? It will remain in your file system in {collection.pathname}. ); }; export default RemoveCollection;