Add advertisements to the recommended videos section
Integrate AdSense ads into the VideoPage, displaying them after the 5th and 10th recommended videos using the `AdSenseAd` component. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 45a1dcfc-f8a2-475a-a6b9-96fbb841dc27 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/60d372ff-2c10-46c7-b01b-10c3435136b0/45a1dcfc-f8a2-475a-a6b9-96fbb841dc27/sMbpUIe
This commit is contained in:
parent
73fc64bb34
commit
75d6cc61f4
@ -788,15 +788,39 @@ export default function VideoPage() {
|
|||||||
<h2 className="text-lg font-semibold text-bunny-light mb-4">Empfohlene Videos</h2>
|
<h2 className="text-lg font-semibold text-bunny-light mb-4">Empfohlene Videos</h2>
|
||||||
|
|
||||||
<div className="space-y-2">
|
<div className="space-y-2">
|
||||||
{recommendedVideos.slice(0, 10).map((video) => (
|
{recommendedVideos.slice(0, 15).map((video, index) => (
|
||||||
<div
|
<div key={video.id}>
|
||||||
key={video.id}
|
{/* Insert ad after 5th video */}
|
||||||
onClick={() => {
|
{index === 5 && (
|
||||||
const shortId = video.id.replace(/-/g, '').substring(0, 8);
|
<div className="w-full flex justify-center py-4 mb-2">
|
||||||
setLocation(`/video/${shortId}`);
|
<AdSenseAd
|
||||||
}}
|
adSlot="8989519684"
|
||||||
className="flex gap-3 p-2 bg-bunny-gray/30 hover:bg-bunny-gray/50 rounded-lg cursor-pointer transition-colors"
|
width={300}
|
||||||
>
|
height={250}
|
||||||
|
className="w-full max-w-[300px]"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{/* Insert ad after 10th video */}
|
||||||
|
{index === 10 && (
|
||||||
|
<div className="w-full flex justify-center py-4 mb-2">
|
||||||
|
<AdSenseAd
|
||||||
|
adSlot="8989519684"
|
||||||
|
width={300}
|
||||||
|
height={250}
|
||||||
|
className="w-full max-w-[300px]"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
<div
|
||||||
|
onClick={() => {
|
||||||
|
const shortId = video.id.replace(/-/g, '').substring(0, 8);
|
||||||
|
setLocation(`/video/${shortId}`);
|
||||||
|
}}
|
||||||
|
className="flex gap-3 p-2 bg-bunny-gray/30 hover:bg-bunny-gray/50 rounded-lg cursor-pointer transition-colors"
|
||||||
|
>
|
||||||
<div className="relative w-24 h-16 bg-gray-700 rounded overflow-hidden flex-shrink-0">
|
<div className="relative w-24 h-16 bg-gray-700 rounded overflow-hidden flex-shrink-0">
|
||||||
<img
|
<img
|
||||||
src={video.thumbnailUrl}
|
src={video.thumbnailUrl}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user