import dayjs from 'dayjs';

export function downloadBlob(blob: Blob, fileName: string) {
  const url = URL.createObjectURL(blob);
  const link = document.createElement('a');

  link.href = url;
  link.download = fileName;
  link.click();

  URL.revokeObjectURL(url);
}

export function getSystemExportFileName(label: string) {
  return `${label}_${dayjs().format('YYYY-MM-DD')}.xls`;
}
