-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#378 Create competency card component
- Loading branch information
1 parent
ac9c222
commit 2a84007
Showing
1 changed file
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
import { | ||
Button, | ||
Card, | ||
CardActionArea, | ||
CardContent, | ||
CardMedia, | ||
Typography, | ||
} from '@mui/material'; | ||
import ChevronRightIcon from '@mui/icons-material/ChevronRight'; | ||
import DoneIcon from '@mui/icons-material/Done'; | ||
|
||
import React from 'react'; | ||
|
||
interface CardProps { | ||
id: number; | ||
image_url: string; | ||
label: string; | ||
} | ||
|
||
const CompetencyCard = ({ id, image_url, label }: CardProps) => { | ||
return ( | ||
<Card | ||
sx={{ | ||
width: 345, | ||
height: 250, | ||
margin: 2, | ||
display: 'flex', | ||
justifyContent: 'center', | ||
alignItems: 'center', | ||
}} | ||
> | ||
<CardActionArea> | ||
<CardMedia component="img" height="200" image={image_url} alt={label} /> | ||
<CardContent | ||
sx={{ | ||
display: 'flex', | ||
justifyContent: 'space-between', | ||
alignItems: 'center', | ||
}} | ||
> | ||
<Typography gutterBottom variant="h5" component="div"> | ||
{label} | ||
</Typography> | ||
<Button | ||
size="small" | ||
color="primary" | ||
component="a" | ||
sx={{ | ||
mr: 1, | ||
display: 'flex', | ||
justifyContent: 'center', | ||
alignItems: 'center', | ||
}} | ||
href={`/competencies/questionnaire/${id}`} | ||
> | ||
Start <ChevronRightIcon /> | ||
</Button> | ||
</CardContent> | ||
</CardActionArea> | ||
</Card> | ||
); | ||
}; | ||
|
||
export default CompetencyCard; |