mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-11 18:33:53 +00:00
feat: added export options (#529)
* feat: added export options * chore: eslint console proposal --------- Co-authored-by: arc-alex <ac@omnivox.dk>
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
.modalHeader {
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
.modalBody {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-top: 1rem;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
import { Button, Modal, ModalBody, ModalCloseButton, ModalContent, ModalHeader, ModalOverlay } from '@chakra-ui/react';
|
||||
|
||||
import styles from './ExportModal.module.scss';
|
||||
|
||||
export type ExportType = 'csv' | 'json';
|
||||
interface ExportModalProps {
|
||||
isOpen: boolean;
|
||||
onClose: (type?: ExportType) => void;
|
||||
buttonVariants: {
|
||||
csv: string;
|
||||
json: string;
|
||||
};
|
||||
}
|
||||
|
||||
export default function ExportModal(props: ExportModalProps) {
|
||||
const { isOpen, onClose, buttonVariants } = props;
|
||||
|
||||
return (
|
||||
<Modal isOpen={isOpen} onClose={onClose} motionPreset='scale' size='xl' colorScheme='blackAlpha'>
|
||||
<ModalOverlay />
|
||||
<ModalContent>
|
||||
<ModalHeader className={styles.modalHeader}>Download options</ModalHeader>
|
||||
<ModalCloseButton />
|
||||
<ModalBody className={styles.modalBody}>
|
||||
<Button onClick={() => onClose('csv')} variant={buttonVariants.csv} width='48%'>
|
||||
rundown as CSV
|
||||
</Button>
|
||||
<Button onClick={() => onClose('json')} variant={buttonVariants.json} width='48%'>
|
||||
Project file
|
||||
</Button>
|
||||
</ModalBody>
|
||||
</ModalContent>
|
||||
</Modal>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user