(skillId: string, btn: HTMLButtonElement)
| 57 | } |
| 58 | |
| 59 | async function copyInstallCommand(skillId: string, btn: HTMLButtonElement): Promise<void> { |
| 60 | const command = `gh skills install ${REPO_IDENTIFIER} ${skillId}`; |
| 61 | const originalContent = btn.innerHTML; |
| 62 | const success = await copyToClipboard(command); |
| 63 | showToast(success ? 'Install command copied!' : 'Failed to copy', success ? 'success' : 'error'); |
| 64 | if (success) { |
| 65 | btn.innerHTML = '<svg viewBox="0 0 16 16" width="16" height="16" fill="currentColor"><path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.75.75 0 0 1 1.06-1.06L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0z"/></svg> Copied!'; |
| 66 | setTimeout(() => { |
| 67 | btn.innerHTML = originalContent; |
| 68 | }, 2000); |
| 69 | } |
| 70 | } |
| 71 | |
| 72 | async function downloadSkill(skillId: string, btn: HTMLButtonElement): Promise<void> { |
| 73 | const skill = allItems.find((item) => item.id === skillId); |
no test coverage detected