mirror of
https://github.com/misode/misode.github.io.git
synced 2026-04-24 07:37:10 +00:00
19 lines
421 B
TypeScript
19 lines
421 B
TypeScript
import { useEffect } from 'preact/hooks'
|
|
|
|
declare const ethicalads: any
|
|
|
|
type AdProps = {
|
|
type: 'text' | 'image',
|
|
id: string,
|
|
}
|
|
export function Ad({ type, id }: AdProps) {
|
|
useEffect(() => {
|
|
document.getElementById('ad-placeholder')?.remove()
|
|
if ('ethicalads' in window) {
|
|
ethicalads.load()
|
|
}
|
|
}, [])
|
|
|
|
return <div data-ea-publisher="misode-github-io" data-ea-type={type} class="ad dark flat" id={id}></div>
|
|
}
|