|
| 1 | +import { Box, Card, CardContent, Icon, Link, Typography, useTheme } from '@mui/material'; |
| 2 | +import { GuestDefinition } from 'shared'; |
| 3 | +import { NERButton } from '../../components/NERButton'; |
| 4 | +import { Link as RouterLink } from 'react-router-dom'; |
| 5 | + |
| 6 | +interface ProjectManagementCardProps { |
| 7 | + definition: GuestDefinition; |
| 8 | +} |
| 9 | + |
| 10 | +const ProjectManagementCard: React.FC<ProjectManagementCardProps> = ({ definition }) => { |
| 11 | + const theme = useTheme(); |
| 12 | + |
| 13 | + return ( |
| 14 | + <Card |
| 15 | + variant="outlined" |
| 16 | + sx={{ |
| 17 | + width: '100%', |
| 18 | + height: '100%', |
| 19 | + display: 'flex', |
| 20 | + flexDirection: 'column', |
| 21 | + background: theme.palette.background.paper, |
| 22 | + borderRadius: 2 |
| 23 | + }} |
| 24 | + > |
| 25 | + <CardContent sx={{ padding: 2, display: 'flex', flexDirection: 'column', flexGrow: 1 }}> |
| 26 | + <Box display="flex" alignItems="center" gap={1} mb={1}> |
| 27 | + {definition.icon && <Icon>{definition.icon}</Icon>} |
| 28 | + <Typography variant="h6" fontWeight="regular"> |
| 29 | + {definition.term} |
| 30 | + </Typography> |
| 31 | + </Box> |
| 32 | + <Typography fontSize={14} color="text.secondary" sx={{ flexGrow: 1 }}> |
| 33 | + {definition.description} |
| 34 | + </Typography> |
| 35 | + {definition.buttonText && definition.buttonLink && ( |
| 36 | + <Link component={RouterLink} to={definition.buttonLink} sx={{ width: '100%', textDecoration: 'none' }}> |
| 37 | + <NERButton |
| 38 | + fullWidth |
| 39 | + sx={{ |
| 40 | + marginTop: 2, |
| 41 | + backgroundColor: theme.palette.error.main, |
| 42 | + color: theme.palette.error.contrastText, |
| 43 | + '&:hover': { |
| 44 | + backgroundColor: theme.palette.error.dark |
| 45 | + } |
| 46 | + }} |
| 47 | + > |
| 48 | + {definition.buttonText} |
| 49 | + </NERButton> |
| 50 | + </Link> |
| 51 | + )} |
| 52 | + </CardContent> |
| 53 | + </Card> |
| 54 | + ); |
| 55 | +}; |
| 56 | + |
| 57 | +export default ProjectManagementCard; |
0 commit comments