| 54 | |
| 55 | // Check if the node or any of its children contains a loading spinner |
| 56 | export function hasLoadingSpinner(node: Node): boolean { |
| 57 | if (node.nodeType === Node.TEXT_NODE) return false; |
| 58 | |
| 59 | // Type guard to check if the node is an Element |
| 60 | if (node instanceof Element && node.classList.contains('fluent-read-loading')) return true; |
| 61 | |
| 62 | // Check children only if the node is an Element |
| 63 | if (node instanceof Element) { |
| 64 | return Array.from(node.children).some(child => hasLoadingSpinner(child)); |
| 65 | } |
| 66 | |
| 67 | return false; |
| 68 | } |
| 69 | |
| 70 | // Check if the node or any of its children contains a retry tag |
| 71 | export function hasRetryTag(node: Node): boolean { |