mirror of
https://github.com/pds-nest/nest.git
synced 2024-11-23 05:24:18 +00:00
17 lines
429 B
JavaScript
17 lines
429 B
JavaScript
|
import React, { isValidElement } from "react"
|
||
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"
|
||
|
|
||
|
|
||
|
export default function make_icon(icon, className) {
|
||
|
if(isValidElement(icon)) {
|
||
|
return <span className={className}>icon</span>;
|
||
|
}
|
||
|
else if(icon) {
|
||
|
return (
|
||
|
<span className={className}><FontAwesomeIcon icon={icon}/></span>
|
||
|
)
|
||
|
}
|
||
|
else {
|
||
|
return null;
|
||
|
}
|
||
|
}
|