Files
frontend-app-learning/src/courseware/course/sequence/sequence-navigation/UnitIcon.jsx
Bilal Qamar b3d33667d4 Updated frontend-build to v12 (#962)
* feat: rebase previous frontend-build upgrade

* chore: make welcome message to default to empty
2023-01-30 12:20:07 -05:00

40 lines
819 B
JavaScript

import React from 'react';
import PropTypes from 'prop-types';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import {
faVideo, faBook, faEdit, faTasks, faLock,
} from '@fortawesome/free-solid-svg-icons';
const UnitIcon = ({ type }) => {
let icon = null;
switch (type) {
case 'video':
icon = faVideo;
break;
case 'other':
icon = faBook;
break;
case 'vertical':
icon = faTasks;
break;
case 'problem':
icon = faEdit;
break;
case 'lock':
icon = faLock;
break;
default:
icon = faBook;
}
return (
<FontAwesomeIcon className="unit-icon" icon={icon} />
);
};
UnitIcon.propTypes = {
type: PropTypes.oneOf(['video', 'other', 'vertical', 'problem', 'lock']).isRequired,
};
export default UnitIcon;