Refactor TechIcon component for improved readability
- Split conditional check for Font Awesome icon into multiple lines for better clarity. - Maintained existing functionality while enhancing code maintainability.
This commit is contained in:
@@ -233,7 +233,11 @@ export const TechIcon: React.FC<TechIconProps> = ({
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Font Awesome icon (IconDefinition has prefix, iconName, and icon properties)
|
// Font Awesome icon (IconDefinition has prefix, iconName, and icon properties)
|
||||||
if (typeof IconComponent === "object" && "prefix" in IconComponent && "iconName" in IconComponent) {
|
if (
|
||||||
|
typeof IconComponent === "object" &&
|
||||||
|
"prefix" in IconComponent &&
|
||||||
|
"iconName" in IconComponent
|
||||||
|
) {
|
||||||
return (
|
return (
|
||||||
<FontAwesomeIcon
|
<FontAwesomeIcon
|
||||||
icon={IconComponent as IconDefinition}
|
icon={IconComponent as IconDefinition}
|
||||||
|
|||||||
Reference in New Issue
Block a user