index.tsx 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. import { AppBody, AppShellRoot } from "@pythnetwork/component-library/AppShell";
  2. import { RootProvider as FumadocsRootProvider } from "fumadocs-ui/provider";
  3. import { NuqsAdapter } from "nuqs/adapters/next/app";
  4. import type { ReactNode } from "react";
  5. import {
  6. AMPLITUDE_API_KEY,
  7. ENABLE_ACCESSIBILITY_REPORTING,
  8. GOOGLE_ANALYTICS_ID,
  9. } from "../../config/server";
  10. import { SearchButton } from "../search-button";
  11. import "./global.css";
  12. export const TABS = [
  13. { segment: "", children: "Home" },
  14. { segment: "price-feeds", children: "Price Feeds" },
  15. { segment: "express-relay", children: "Express Relay" },
  16. { segment: "entropy", children: "Entropy" },
  17. ];
  18. type Props = {
  19. children: ReactNode;
  20. };
  21. export const Root = ({ children }: Props) => (
  22. <AppShellRoot
  23. amplitudeApiKey={AMPLITUDE_API_KEY}
  24. googleAnalyticsId={GOOGLE_ANALYTICS_ID}
  25. enableAccessibilityReporting={ENABLE_ACCESSIBILITY_REPORTING}
  26. providers={[NuqsAdapter]}
  27. >
  28. <FumadocsRootProvider
  29. search={{
  30. enabled: true,
  31. options: {
  32. api: "/api/search",
  33. },
  34. }}
  35. >
  36. <AppBody
  37. appName="Developer Hub"
  38. displaySupportButton={false}
  39. extraCta={<SearchButton />}
  40. mainCta={{
  41. label: "Developer Forum",
  42. href: "https://dev-forum.pyth.network/",
  43. }}
  44. tabs={TABS}
  45. >
  46. {children}
  47. </AppBody>
  48. </FumadocsRootProvider>
  49. </AppShellRoot>
  50. );