(content: string, filename: string)
| 12 | } |
| 13 | |
| 14 | export function downloadCSV(content: string, filename: string): void { |
| 15 | const blob = new Blob([content], { type: 'text/csv;charset=utf-8;' }); |
| 16 | const url = URL.createObjectURL(blob); |
| 17 | const link = document.createElement('a'); |
| 18 | link.href = url; |
| 19 | link.download = filename; |
| 20 | document.body.appendChild(link); |
| 21 | link.click(); |
| 22 | document.body.removeChild(link); |
| 23 | URL.revokeObjectURL(url); |
| 24 | } |
| 25 | |
| 26 | export function cohortMembersToCSV(profileIds: string[]): string { |
| 27 | if (!profileIds.length) return ''; |
no test coverage detected