Spaces:
Paused
Paused
Download app/layout.tsx from samirhosninet/HubAPI: direct link, hf CLI and curl.
- Browser
- Download file 9.29 kB
-
https://huggingface.co/spaces/samirhosninet/HubAPI/resolve/main/app/layout.tsx
- Command line
-
hf download hf://spaces/samirhosninet/HubAPI/app/layout.tsx
-
curl -L -o layout.tsx https://huggingface.co/spaces/samirhosninet/HubAPI/resolve/main/app/layout.tsx
9.29 kB
| import type { Metadata } from "next"; | |
| import { | |
| Geist_Mono, | |
| Geist, | |
| Instrument_Serif, | |
| IBM_Plex_Sans_Arabic, | |
| } from "next/font/google"; | |
| import localFont from "next/font/local"; | |
| import "./globals.css"; | |
| import { Header } from "@/components/header"; | |
| import { Footer } from "@/components/footer"; | |
| import { cn } from "@/lib/utils"; | |
| import { ThemeProvider } from "@/components/theme-provider"; | |
| import Script from "next/script"; | |
| import { cookies, headers } from "next/headers"; | |
| const geist = Geist({ subsets: ["latin"], variable: "--font-sans" }); | |
| const geistMono = Geist_Mono({ | |
| variable: "--font-geist-mono", | |
| subsets: ["latin"], | |
| }); | |
| const instrumentSerif = Instrument_Serif({ | |
| variable: "--font-display", | |
| subsets: ["latin"], | |
| weight: "400", | |
| }); | |
| const ibmPlexArabic = IBM_Plex_Sans_Arabic({ | |
| variable: "--font-arabic", | |
| subsets: ["arabic"], | |
| weight: ["300", "400", "500", "600", "700"], | |
| }); | |
| const fastHand = localFont({ | |
| src: "./fonts/FastHand.otf", | |
| variable: "--font-fast-hand", | |
| }); | |
| const SITE_URL = ( | |
| process.env.NEXT_PUBLIC_SITE_URL ?? | |
| "https://darkslategrey-nightingale-132659.hostingersite.com" | |
| ).replace(/\/$/, ""); | |
| export const metadata: Metadata = { | |
| metadataBase: new URL(SITE_URL), | |
| title: "HUBAPI — Pre-Launch Marketing Showcase & Waitlist", | |
| description: | |
| "One planned gateway for multiple LLM providers. Access leading AI models through a unified API layer.", | |
| alternates: { | |
| canonical: SITE_URL, | |
| languages: { | |
| en: `${SITE_URL}/?lang=en`, | |
| ar: `${SITE_URL}/?lang=ar`, | |
| }, | |
| }, | |
| openGraph: { | |
| title: "HUBAPI — Pre-Launch Marketing Showcase", | |
| description: | |
| "One planned gateway for multiple LLM providers. Standard REST API, multi-model access, unified billing, and a developer-first dashboard.", | |
| url: SITE_URL, | |
| siteName: "HUBAPI", | |
| images: [ | |
| { | |
| url: "/og-image.png", | |
| width: 1200, | |
| height: 630, | |
| alt: "HUBAPI — Pre-Launch Marketing Showcase", | |
| }, | |
| ], | |
| type: "website", | |
| }, | |
| twitter: { | |
| card: "summary_large_image", | |
| title: "HUBAPI — Pre-Launch Marketing Showcase", | |
| description: | |
| "One planned gateway for multiple LLM providers. Standard REST API, multi-model access, unified billing, and a developer-first dashboard.", | |
| images: ["/og-image.png"], | |
| }, | |
| }; | |
| import { SplitFlapAudioProvider } from "@/components/ui/split-flap-text"; | |
| import { WaitlistSocialProofTicker } from "@/components/WaitlistSocialProofTicker"; | |
| import { LanguageProvider } from "@/components/LanguageContext"; | |
| import { SkipToContent } from "@/components/SkipToContent"; | |
| export default async function RootLayout({ | |
| children, | |
| }: Readonly<{ | |
| children: React.ReactNode; | |
| }>) { | |
| const cookieStore = await cookies(); | |
| const langCookie = cookieStore.get("hubapi_lang")?.value; | |
| let lang = "en"; | |
| if (langCookie === "ar" || langCookie === "en") { | |
| lang = langCookie; | |
| } else { | |
| const headersList = await headers(); | |
| const acceptLanguage = headersList.get("accept-language") || ""; | |
| if (acceptLanguage.toLowerCase().includes("ar")) { | |
| lang = "ar"; | |
| } | |
| } | |
| const dir = lang === "ar" ? "rtl" : "ltr"; | |
| return ( | |
| <html | |
| lang={lang} | |
| dir={dir} | |
| className={cn("font-sans", geist.variable)} | |
| suppressHydrationWarning | |
| > | |
| <head> | |
| {/* Google Tag Manager */} | |
| <Script | |
| id="gtm-head" | |
| strategy="afterInteractive" | |
| dangerouslySetInnerHTML={{ | |
| __html: `(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': | |
| new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], | |
| j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= | |
| 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); | |
| })(window,document,'script','dataLayer','GTM-WHZJJT9H');`, | |
| }} | |
| /> | |
| </Script> | |
| </> | |
| )} | |
| <SkipToContent /> | |
| <Header /> | |
| {children} | |
| <Footer /> | |
| <WaitlistSocialProofTicker /> | |
| </SplitFlapAudioProvider> | |
| </ThemeProvider> | |
| </LanguageProvider> | |
| </body> | |
| </html> | |
| ); | |
| } | |