({ ...props }: BoxProps)
| 7 | import classes from './CarbonAd.module.css'; |
| 8 | |
| 9 | export const CarbonAd = ({ ...props }: BoxProps) => { |
| 10 | const location = useLocation(); |
| 11 | |
| 12 | // We need to rerender the carbon ad when the route changes |
| 13 | // biome-ignore lint/correctness/useExhaustiveDependencies: Selective. |
| 14 | useEffect(() => { |
| 15 | const script = document.createElement('script'); |
| 16 | script.src = |
| 17 | '//cdn.carbonads.com/carbon.js?serve=CEAI42QN&placement=fontsourceorg'; |
| 18 | script.id = '_carbonads_js'; |
| 19 | script.async = true; |
| 20 | document.querySelector('#carbonads')?.replaceWith(script); |
| 21 | }, [location]); |
| 22 | |
| 23 | return ( |
| 24 | <Box className={classes.wrapper} {...props}> |
| 25 | <Balancer> |
| 26 | <span id="carbonads" /> |
| 27 | </Balancer> |
| 28 | </Box> |
| 29 | ); |
| 30 | }; |
nothing calls this directly
no outgoing calls
no test coverage detected