()
| 145 | const reports: Array<SocialReport> = [] |
| 146 | |
| 147 | for (const social of SOCIALS) { |
| 148 | const found: Partial<SocialMeta> = {} |
| 149 | const missing: Array<string> = [] |
| 150 | for (const tag of social.tags) { |
| 151 | const meta = metaTags.find( |
| 152 | (m) => |
| 153 | (tag.key.includes('twitter:') |
| 154 | ? false |
| 155 | : m.getAttribute('property') === tag.key) || |
| 156 | m.getAttribute('name') === tag.key, |
| 157 | ) |
| 158 | |
| 159 | if (meta && meta.getAttribute('content')) { |
| 160 | found[tag.prop as keyof SocialMeta] = |
| 161 | meta.getAttribute('content') || undefined |
| 162 | } else { |
| 163 | missing.push(tag.key) |
| 164 | } |
| 165 | } |
| 166 | reports.push({ network: social.network, found, missing }) |
| 167 | } |
| 168 | return reports |
| 169 | } |
| 170 | |
| 171 | createHeadChanges(() => { |
| 172 | setReports(analyzeHead()) |
| 173 | }) |
| 174 | |
| 175 | return ( |
| 176 | <Section> |
no outgoing calls
no test coverage detected