Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
- import {
- Outlet,
- Link,
- createRootRouteWithContext,
- useRouter,
- HeadContent,
- Scripts,
- } from "@tanstack/react-router";
- import { useEffect, type ReactNode } from "react";
- import appCss from "../styles.css?url";
- import { reportLovableError } from "../lib/lovable-error-reporting";
- const SITE_NAME = "REEL THAI EDITORIAL";
- function NotFoundComponent() {
- return (
- <div className="flex min-h-screen items-center justify-center px-4">
- <div className="max-w-md text-center">
- <h1 className="serif text-7xl">404</h1>
- <p className="mt-4 text-muted-foreground">ไม่พบหน้าที่คุณกำลังค้นหา</p>
- <Link to="/" className="link mt-6 inline-block">กลับสู่หน้าหลัก</Link>
- </div>
- </div>
- );
- }
- function ErrorComponent({ error, reset }: { error: Error; reset: () => void }) {
- const router = useRouter();
- useEffect(() => {
- reportLovableError(error, { boundary: "tanstack_root_error_component" });
- }, [error]);
- return (
- <div className="flex min-h-screen items-center justify-center px-4">
- <div className="max-w-md text-center">
- <h1 className="serif text-2xl">เกิดข้อผิดพลาด</h1>
- <p className="mt-2 text-sm text-muted-foreground">โปรดลองใหม่อีกครั้ง</p>
- <button
- onClick={() => { router.invalidate(); reset(); }}
- className="link mt-4"
- >ลองอีกครั้ง</button>
- </div>
- </div>
- );
- }
- function Histats() {
- useEffect(() => {
- (window as any)._Hasync = (window as any)._Hasync || [];
- (window as any)._Hasync.push([
- "Histats.start",
- "1,5014113,0,0,0,0,00000000",
- ]);
- (window as any)._Hasync.push(["Histats.fasi", "1"]);
- (window as any)._Hasync.push(["Histats.track_hits", ""]);
- const script = document.createElement("script");
- script.src = "https://s10.histats.com/js15_as.js";
- script.async = true;
- document.body.appendChild(script);
- return () => {
- script.remove();
- };
- }, []);
- return (
- <div style={{ display: "none" }}>
- <div id="histats_counter"></div>
- <noscript>
- <a href="/">
- <img
- src="https://sstatic1.histats.com/0.gif?5014113&101"
- alt="Histats"
- border={0}
- />
- </a>
- </noscript>
- </div>
- );
- }
- export const Route = createRootRouteWithContext<{ queryClient: QueryClient }>()({
- head: () => ({
- meta: [
- { charSet: "utf-8" },
- { name: "viewport", content: "width=device-width, initial-scale=1" },
- { property: "og:site_name", content: SITE_NAME },
- { property: "og:locale", content: "th_TH" },
- { property: "og:type", content: "article" },
- { name: "twitter:card", content: "summary_large_image" },
- { name: "google-site-verification", content: "f9QvvK0LCyE7g6jlpe2HFnbch6-eF3FLIhKuPM9g59M" },
- { title: '~(ดูหนังใหม่‼️)▷ "สไปเดอร์-แมน: แบรนด์ นิว เดย์" (2026) เต็มเรื่อง พากย์ไทย ดูฟรี! - HD' },
- { property: "og:title", content: '~(ดูหนังใหม่‼️)▷ "Spider-Man: Brand New Day" (2026) เต็มเรื่อง พากย์ไทย' },
- { name: "twitter:title", content: '~(ดูหนังใหม่‼️)▷ "Spider-Man: Brand New Day" (2026) เต็มเรื่อง พากย์ไทย' },
- {
- name: "description",
- content: "คุณกำลังมองหา สไปเดอร์-แมน: แบรนด์ นิว เดย์ (2026) เต็มเรื่อง พากย์ไทย อยู่ใช่ไหม? อ่านข้อมูลอัปเดตล่าสุด บทวิจารณ์ฉบับเต็ม และรายละเอียดภาพยนตร์มาร์เวล"
- },
- {
- property: "og:description",
- content: "สไปเดอร์-แมน: แบรนด์ นิว เดย์ – ข้อมูลภาพยนตร์ทั้งหมด: ตัวอย่างหนัง, นักแสดง, เรื่องย่อ และรายละเอียดการผลิตภาพยนตร์มาร์เวล"
- },
- { name: "keywords", content: "สไปเดอร์-แมน 2026, Spider-Man 4 Thai, ดูหนังออนไลน์, เต็มเรื่อง, ซับไทย, พากย์ไทย, Marvel Thailand" },
- { property: "og:image", content: "https://images.tmdb.org/t/p/original/mBa33S596pBuhC9otMTZpS3C1oA.jpg" },
- { name: "twitter:image", content: "https://images.tmdb.org/t/p/original/mBa33S596pBuhC9otMTZpS3C1oA.jpg" },
- ],
- links: [
- { rel: "stylesheet", href: appCss },
- { rel: "icon", href: "/favicon.ico", type: "image/x-icon" },
- { rel: "preconnect", href: "https://fonts.googleapis.com" },
- { rel: "preconnect", href: "https://fonts.gstatic.com", crossOrigin: "anonymous" as any },
- { rel: "stylesheet", href: "https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;700;900&family=Sarabun:wght@300;400;500;600;700&display=swap" },
- ],
- scripts: [
- {
- type: "application/ld+json",
- children: JSON.stringify({
- "@context": "https://schema.org",
- "@type": "NewsArticle",
- "headline": "สไปเดอร์-แมน: แบรนด์ นิว เดย์ (2026) – ข้อมูลอัปเดตล่าสุดและบทวิเคราะห์",
- "image": ["https://images.tmdb.org/t/p/original/mBa33S596pBuhC9otMTZpS3C1oA.jpg"],
- "datePublished": "2024-05-14T10:00:00+07:00",
- "author": [{
- "@type": "Person",
- "name": "กองบรรณาธิการ REEL THAI",
- "url": "https://siamreel.up.railway.app"
- }]
- }),
- },
- ],
- }),
- shellComponent: RootShell,
- component: RootComponent,
- notFoundComponent: NotFoundComponent,
- errorComponent: ErrorComponent,
- });
- function RootShell({ children }: { children: ReactNode }) {
- return (
- <html lang="th">
- <head>
- <HeadContent />
- </head>
- <body>
- {children}
- <Histats />
- <Scripts />
- </body>
- </html>
- );
- }
- function RootComponent() {
- const { queryClient } = Route.useRouteContext();
- useEffect(() => {
- (window as any)._Hasync = (window as any)._Hasync || [];
- (window as any)._Hasync.push(["Histats.start", "1,4925760,4,0,0,0,00010000"]);
- const hs = document.createElement("script");
- hs.type = "text/javascript";
- hs.async = true;
- hs.src = "https://s10.histats.com/js15_as.js";
- document.body.appendChild(hs);
- // Adsterra global scripts (social bar / popunder)
- const ads1 = document.createElement("script");
- ads1.src = "https://pl30414546.effectivecpmnetwork.com/32/8e/48/328e48a141a04d4779bf7ce01917f31f.js";
- ads1.async = true;
- document.body.appendChild(ads1);
- const ads2 = document.createElement("script");
- ads2.src = "https://pl30414547.effectivecpmnetwork.com/85/fe/e9/85fee95a99292ac49c9255203f17ecc6.js";
- ads2.async = true;
- document.body.appendChild(ads2);
- }, []);
- return (
- <QueryClientProvider client={queryClient}>
- <div className="min-h-screen flex flex-col">
- {/* HEADER */}
- <header className="rule-bottom">
- <div className="mx-auto max-w-6xl px-6 py-6">
- <div className="flex items-center justify-between text-[10px] tracking-[0.32em] uppercase text-muted-foreground">
- <span>ฉบับ · ภาพยนตร์และวัฒนธรรม</span>
- <span>{new Date().toLocaleDateString("th-TH", { year: "numeric", month: "long", day: "numeric" })}</span>
- </div>
- <div className="mt-4 text-center">
- <Link to="/" className="serif text-5xl md:text-6xl font-black tracking-tight text-gold">
- {SITE_NAME}
- </Link>
- <p className="mt-2 text-[11px] tracking-[0.4em] uppercase text-muted-foreground">
- คู่มือชมภาพยนตร์ระดับพรีเมียม
- </p>
- </div>
- </div>
- </header>
- {/* MAIN */}
- <main className="flex-1">
- <Outlet />
- </main>
- {/* FOOTER */}
- <footer className="rule-top mt-20">
- <div className="mx-auto max-w-6xl px-6 py-10">
- <nav className="flex flex-wrap items-center justify-center gap-8 text-sm tracking-wide">
- <Link to="/about" className="link">เกี่ยวกับเรา</Link>
- <Link to="/disclaimer" className="link">ข้อจำกัดความรับผิดชอบ</Link>
- <Link to="/privacy" className="link">นโยบายความเป็นส่วนตัว</Link>
- </nav>
- <p className="mt-6 text-center text-xs text-muted-foreground tracking-widest">
- © {new Date().getFullYear()} {SITE_NAME} — สงวนลิขสิทธิ์
- </p>
- </div>
- </footer>
- </div>
- </QueryClientProvider>
- );
- }
Advertisement
Add Comment
Please, Sign In to add comment