11import React from "react" ;
22import PropTypes from "prop-types" ;
33
4- const Icon = ( { name = "home" , size = 12 , color = "black" } ) => {
4+ const Icon = ( { name = "home" , size = 12 , color = "black" , disableAnimation = false } ) => {
55 const sizeClasses = {
66 4 : "size-4" ,
77 6 : "size-6" ,
@@ -15,14 +15,15 @@ const Icon = ({ name = "home", size = 12, color = "black" }) => {
1515
1616 const colorClasses = {
1717 "white" : "text-white" ,
18- "black" : "text-black group-hover:text-white " ,
19- "primary" : "text-primary group-hover:text-white " ,
20- "danger" : "text-danger group-hover:text-white "
18+ "black" : "text-black group-hover:text-black " ,
19+ "primary" : "text-primary group-hover:text-primary " ,
20+ "danger" : "text-danger group-hover:text-danger "
2121 }
2222
2323 const sizeClass = sizeClasses [ size ] || sizeClasses [ 12 ] ;
2424 const colorClass = colorClasses [ color ] || sizeClasses [ "black" ] ;
25- const className = [ "transition transform duration-300 stroke-1 hover:scale-105" ,
25+ const animationClass = disableAnimation ? "" : "hover:scale-105" ;
26+ const className = [ "transition transform duration-300 stroke-[1.3]" , animationClass ,
2627 colorClass , sizeClass ] . join ( " " ) ;
2728
2829 const icons = {
@@ -198,13 +199,22 @@ const Icon = ({ name = "home", size = 12, color = "black" }) => {
198199 < svg className = { className } xmlns = "http://www.w3.org/2000/svg" fill = "none" viewBox = "0 0 24 24" strokeWidth = { 1.5 } stroke = "currentColor" >
199200 < path strokeLinecap = "round" strokeLinejoin = "round" d = "m5.25 4.5 7.5 7.5-7.5 7.5m6-15 7.5 7.5-7.5 7.5" />
200201 </ svg >
202+ ) ,
203+ "exclamation-triangle" : (
204+ < svg className = { className } xmlns = "http://www.w3.org/2000/svg" fill = "none" viewBox = "0 0 24 24" strokeWidth = { 1.5 } stroke = "currentColor" >
205+ < path strokeLinecap = "round" strokeLinejoin = "round" d = "M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z" />
206+ </ svg > ) ,
207+ "exclamation-circle" : ( < svg className = { className } xmlns = "http://www.w3.org/2000/svg" fill = "none" viewBox = "0 0 24 24" strokeWidth = { 1.5 } stroke = "currentColor" >
208+ < path strokeLinecap = "round" strokeLinejoin = "round" d = "M12 9v3.75m9-.75a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 3.75h.008v.008H12v-.008Z" />
209+ </ svg >
201210 )
202211 }
203212
204213 Icon . propTypes = {
205214 name : PropTypes . oneOf ( Object . keys ( icons ) ) ,
206215 size : PropTypes . oneOf ( Object . keys ( sizeClasses ) ) ,
207- color : PropTypes . oneOf ( Object . keys ( colorClasses ) )
216+ color : PropTypes . oneOf ( Object . keys ( colorClasses ) ) ,
217+ disableAnimation : PropTypes . bool
208218 }
209219
210220 const iconSvg = icons [ name ] || icons [ "home" ] ;
0 commit comments