forked from notionnext-org/NotionNext
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWWAds.js
More file actions
28 lines (25 loc) · 705 Bytes
/
Copy pathWWAds.js
File metadata and controls
28 lines (25 loc) · 705 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import { siteConfig } from '@/lib/config'
/**
* 万维广告插件
* @param {string} orientation - 广告方向,可以是 'vertical' 或 'horizontal'
* @param {boolean} sticky - 是否粘性定位
* @returns {JSX.Element | null} - 返回渲染的 JSX 元素或 null
*/
export default function WWAds({
orientation = 'vertical',
sticky = false,
className
}) {
const AD_WWADS_ID = siteConfig('AD_WWADS_ID')
if (!AD_WWADS_ID) {
return null
}
return (
<div
data-id={AD_WWADS_ID}
className={`wwads-cn
${orientation === 'vertical' ? 'wwads-vertical' : 'wwads-horizontal'}
${sticky ? 'wwads-sticky' : ''} z-10 ${className || ''}`}
/>
)
}