|
| 1 | +/** |
| 2 | + * Copyright (c) 2024, RTE (http://www.rte-france.com) |
| 3 | + * This Source Code Form is subject to the terms of the Mozilla Public |
| 4 | + * License, v. 2.0. If a copy of the MPL was not distributed with this |
| 5 | + * file, You can obtain one at http://mozilla.org/MPL/2.0/. |
| 6 | + */ |
| 7 | + |
| 8 | +import React from 'react'; |
| 9 | +import { Box, Button } from '@mui/material'; |
| 10 | +import { FormattedMessage } from 'react-intl'; |
| 11 | +import CircleIcon from './icons/circleIcon'; |
| 12 | +import CreateNewFolderOutlinedIcon from '@mui/icons-material/CreateNewFolderOutlined'; |
| 13 | + |
| 14 | +const CIRCLE_SIZE = 200; |
| 15 | + |
| 16 | +const stylesIcon = { |
| 17 | + circle: (theme: any) => ({ |
| 18 | + backgroundColor: theme.row.primary, |
| 19 | + }), |
| 20 | +}; |
| 21 | + |
| 22 | +interface NoContentDirectoryProps { |
| 23 | + handleOpenDialog: () => void; |
| 24 | +} |
| 25 | + |
| 26 | +const NoContentDirectory: React.FC<NoContentDirectoryProps> = ({ |
| 27 | + handleOpenDialog, |
| 28 | +}) => { |
| 29 | + const styles = { |
| 30 | + noContentContainer: (theme: any) => ({ |
| 31 | + display: 'flex', |
| 32 | + flexDirection: 'column', |
| 33 | + alignItems: 'center', |
| 34 | + marginTop: theme.spacing(20), |
| 35 | + }), |
| 36 | + noContentText: (theme: any) => ({ |
| 37 | + color: theme.row.primary, |
| 38 | + textAlign: 'center', |
| 39 | + marginTop: theme.spacing(1), |
| 40 | + }), |
| 41 | + noContentButton: { |
| 42 | + borderRadius: '30px', |
| 43 | + }, |
| 44 | + iconSize: { |
| 45 | + fontSize: CIRCLE_SIZE / 2, |
| 46 | + }, |
| 47 | + }; |
| 48 | + |
| 49 | + return ( |
| 50 | + <Box sx={styles.noContentContainer}> |
| 51 | + <CircleIcon size={CIRCLE_SIZE} iconStyles={stylesIcon.circle}> |
| 52 | + <CreateNewFolderOutlinedIcon sx={styles.iconSize} /> |
| 53 | + </CircleIcon> |
| 54 | + <Box sx={styles.noContentText}> |
| 55 | + <h1> |
| 56 | + <FormattedMessage id={'createFirstDir'} /> |
| 57 | + </h1> |
| 58 | + <Button |
| 59 | + variant="contained" |
| 60 | + sx={styles.noContentButton} |
| 61 | + onClick={handleOpenDialog} |
| 62 | + > |
| 63 | + <FormattedMessage id={'createFolder'} /> |
| 64 | + </Button> |
| 65 | + </Box> |
| 66 | + </Box> |
| 67 | + ); |
| 68 | +}; |
| 69 | + |
| 70 | +export default NoContentDirectory; |
0 commit comments