mirror of
https://github.com/pds-nest/nest.git
synced 2024-11-26 23:14:19 +00:00
17 lines
No EOL
427 B
JavaScript
17 lines
No EOL
427 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
|
|
}
|
|
} |