(overlay, on, message, tone = '')
| 436 | } |
| 437 | |
| 438 | function setPreviewLoading(overlay, on, message, tone = '') { |
| 439 | const loader = ensurePreviewLoader(overlay); |
| 440 | if (!loader) return; |
| 441 | const icon = loader.querySelector('.preview-loading-icon'); |
| 442 | const textEl = loader.querySelector('.preview-loading-text'); |
| 443 | const label = message || (t('loading') || 'Loading...'); |
| 444 | if (textEl) textEl.textContent = label; |
| 445 | |
| 446 | if (icon) { |
| 447 | if (tone === 'error') { |
| 448 | icon.textContent = 'error_outline'; |
| 449 | icon.classList.remove('spinning'); |
| 450 | loader.style.color = '#e11d48'; |
| 451 | } else { |
| 452 | icon.textContent = 'autorenew'; |
| 453 | icon.classList.add('spinning'); |
| 454 | loader.style.color = 'inherit'; |
| 455 | } |
| 456 | } |
| 457 | |
| 458 | loader.style.display = on ? 'flex' : 'none'; |
| 459 | } |
| 460 | |
| 461 | function setTitle(overlay, name) { |
| 462 | const textEl = overlay.querySelector('.title-text'); |
no test coverage detected