(text: string)
| 68 | } |
| 69 | |
| 70 | function getDefaultSuccessMessage(text: string): string | null { |
| 71 | const preview = text.replace(/\s+/g, ' ').trim() |
| 72 | if (!preview) { |
| 73 | return null |
| 74 | } |
| 75 | const truncated = preview.length > 40 ? `${preview.slice(0, 37)}…` : preview |
| 76 | return `Copied: "${truncated}"` |
| 77 | } |
| 78 | |
| 79 | export interface CopyToClipboardOptions { |
| 80 | successMessage?: string | null |
no outgoing calls
no test coverage detected