MCPcopy Create free account
hub / github.com/code-forge-io/react-router-devtools / copyIcon

Function copyIcon

plugins/icon-library/icon-library.tsx:23–35  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

21const 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")}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…