diff --git a/src/app/layout.tsx b/src/app/layout.tsx
index eeaf3e7d..5e80b792 100644
--- a/src/app/layout.tsx
+++ b/src/app/layout.tsx
@@ -1,5 +1,6 @@
import type { Metadata } from 'next';
import localFont from 'next/font/local';
+import Script from 'next/script';
import './globals.css';
import Header from '@/components/layout/Header';
import Footer from '@/components/layout/Footer';
@@ -23,6 +24,14 @@ export default function RootLayout({ children }: { children: React.ReactNode })
return (
+ {process.env.NEXT_PUBLIC_ADSENSE_PUBLISHER_ID && (
+
+ )}
diff --git a/src/components/ads/AdSense.tsx b/src/components/ads/AdSense.tsx
new file mode 100644
index 00000000..f5023289
--- /dev/null
+++ b/src/components/ads/AdSense.tsx
@@ -0,0 +1,40 @@
+'use client';
+
+import { useEffect } from 'react';
+
+interface AdSenseProps {
+ slot: string;
+ style?: React.CSSProperties;
+ className?: string;
+ format?: 'auto' | 'fluid' | 'rectangle' | 'vertical' | 'horizontal';
+ responsive?: boolean;
+}
+
+export default function AdSense({
+ slot,
+ style,
+ className,
+ format = 'auto',
+ responsive = true,
+}: AdSenseProps) {
+ const publisherId = process.env.NEXT_PUBLIC_ADSENSE_PUBLISHER_ID;
+
+ useEffect(() => {
+ try {
+ (window.adsbygoogle = window.adsbygoogle || []).push({});
+ } catch {}
+ }, []);
+
+ if (!publisherId) return null;
+
+ return (
+
+ );
+}
diff --git a/src/types/global.d.ts b/src/types/global.d.ts
new file mode 100644
index 00000000..1eb503ae
--- /dev/null
+++ b/src/types/global.d.ts
@@ -0,0 +1,3 @@
+interface Window {
+ adsbygoogle: unknown[];
+}