()
| 21 | const ClickableIcon = ({ name, size, ...props }: IconProps) => { |
| 22 | const [clicked, setClicked] = React.useState(false) |
| 23 | const copyIcon = () => { |
| 24 | setClicked(true) |
| 25 | // Shows toast that you copied the icon |
| 26 | //toast("Copied to clipboard"); |
| 27 | // Writes the icon to the clipboard |
| 28 | navigator.clipboard.writeText( |
| 29 | `<Icon name="${name}" size="${size}"${props.className ? ` className="${props.className}"` : ""} />` |
| 30 | ) |
| 31 | // Reverts the icon from checked to normal after 1.5 seconds |
| 32 | setTimeout(() => { |
| 33 | setClicked(false) |
| 34 | }, 1500) |
| 35 | } |
| 36 | return ( |
| 37 | <Icon |
| 38 | className={clsx(props.className, clicked ? "text-green-500" : "hover:cursor-pointer")} |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…