import { Box, Flex, Heading, Image, Link } from '@chakra-ui/react'; import { event } from '../lib/gtag'; function getPageSlug() { const pathname = (typeof window !== 'undefined' ? window : {} as any)?.location?.pathname || ''; return pathname?.replace(/\//g, ''); } export const CustomAd = () => { const slug = getPageSlug(); if (slug !== 'devops') { return null; } return ( { event({ category: 'SponsorClick', action: `TNS EBook Redirect`, label: `Clicked TNS EBook Link` }); }} > Custom Logo Free DevOps eBook Learn all about doing DevOps the Cloud Native way with this free ebook from our partner, The New Stack Partner Content ); };