( isCopied: boolean, isHovered: boolean, leadingSpace: boolean, )
| 27 | * Exported for testing. |
| 28 | */ |
| 29 | export const getCopyIconText = ( |
| 30 | isCopied: boolean, |
| 31 | isHovered: boolean, |
| 32 | leadingSpace: boolean, |
| 33 | ): string => { |
| 34 | const space = leadingSpace ? ' ' : '' |
| 35 | if (isCopied) return `${space}${COPY_ICON_COPIED}` |
| 36 | if (isHovered) return `${space}${COPY_ICON_EXPANDED}` |
| 37 | return `${space}${COPY_ICON_COLLAPSED}` |
| 38 | } |
| 39 | |
| 40 | /** |
| 41 | * State transition handlers for the copy button. |
no outgoing calls
no test coverage detected