export const downloadCsv = (filename: string, headers: string[], rows: (string | number)[][]) => {
  const lines = [headers.join(','), ...rows.map((row) => row.join(','))]
  const blob = new Blob([lines.join('\n')], { type: 'text/csv;charset=utf-8;' })
  const link = document.createElement('a')
  link.href = URL.createObjectURL(blob)
  link.download = filename
  link.click()
  URL.revokeObjectURL(link.href)
}
