✨ feat(atoms): add Award entry

This commit is contained in:
2024-02-17 10:29:50 +01:00
parent feb6e9e246
commit 2e6ce3941a
2 changed files with 38 additions and 0 deletions
+37
View File
@@ -0,0 +1,37 @@
import React from 'react'
import { Box, SxProps, Theme, Typography, TypographyProps } from '@mui/material'
type AwardEntryProps = {
year: string | number
title: React.ReactNode
titleProps?: TypographyProps
organization: React.ReactNode
location: string
Component?: React.ElementType
sx?: SxProps<Theme>
}
const Award = ({ Component = Box, ...props }: AwardEntryProps) => {
return (
<Component sx={{ pl: 2, ...props.sx }}>
<Box display="flex" gap={1} alignItems={{ sm: 'flex-start', md: 'center' }}>
<Typography variant="subtitle1" color="primary.main">
{props.year}
</Typography>
<Box display={{ sm: 'block', md: 'flex' }} flexGrow={1} columnGap={1} flexWrap="wrap" alignItems="flex-end">
<Typography variant="subtitle1" {...props.titleProps}>
<b>{props.title}</b>
</Typography>
<Typography variant="button" color="text.secondary" flexGrow={1}>
{props.organization}
</Typography>
<Typography variant="subtitle2" color="text.secondary" flexShrink={0}>
<em>{props.location}</em>
</Typography>
</Box>
</Box>
</Component>
)
}
export default Award
+1
View File
@@ -0,0 +1 @@
export { default } from './Award'