ente/src/pages/gallery/components/CollectionSelector.tsx

50 lines
1.5 KiB
TypeScript
Raw Normal View History

import React from 'react';
import { Button, Card, Modal } from 'react-bootstrap';
import CollectionDropZone from './CollectionDropZone';
2021-01-07 10:45:18 +00:00
import PreviewCard from './PreviewCard';
function CollectionSelector({
modalView,
closeModal,
collectionLatestFile,
showProgress,
}) {
const CollectionIcons = collectionLatestFile?.map((item) => (
<CollectionDropZone key={item.collectionID}
closeModal={closeModal}
collectionLatestFile={item}
noDragEventsBubbling
showProgress={showProgress}
>
2021-01-06 17:54:06 +00:00
<Card style={{ cursor: 'pointer', border: 'solid', width: "95%", marginBottom: "5px", padding: "auto" }}>
2021-01-07 10:45:18 +00:00
<PreviewCard data={item.file} updateUrl={() => { }} onClick={() => { }} />
<Card.Body>
2021-01-07 10:45:18 +00:00
<Card.Text>{item.collection.name}</Card.Text>
</Card.Body>
</Card>
</CollectionDropZone>
));
return (
<Modal
show={modalView}
aria-labelledby='contained-modal-title-vcenter'
centered
onHide={closeModal}
>
<Modal.Header closeButton>
<Modal.Title id='contained-modal-title-vcenter'>
Select/Click on Collection to upload
</Modal.Title>
</Modal.Header>
<Modal.Body style={{ display: "flex", justifyContent: "space-between", flexWrap: "wrap" }}>
{CollectionIcons}
</Modal.Body>
<Modal.Footer>
<Button onClick={closeModal}>Close</Button>
</Modal.Footer>
</Modal>
);
}
export default CollectionSelector;