export function downloadSelectedExcel(resource, ids, parameters = {}) {
  const selected = [...new Set((ids || []).filter(Boolean))];
  if (!selected.length) return false;
  const params = new URLSearchParams(parameters);
  params.set('ids', selected.join(','));
  const anchor = document.createElement('a');
  anchor.href = `/api/admin/excel/${resource}?${params}`;
  anchor.click();
  return true;
}
