app.tsx 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import { MetaProvider, Meta, Title } from "@solidjs/meta"
  2. import { Router } from "@solidjs/router"
  3. import { FileRoutes } from "@solidjs/start/router"
  4. import { Suspense } from "solid-js"
  5. import "./app.css"
  6. function stripLocaleDataPrefix(pathname: string) {
  7. const value = pathname.startsWith("/") ? pathname : `/${pathname}`
  8. return value.replace(/^\/[^/]+(?=\/data(?:\/|$))/, "")
  9. }
  10. function AppMeta() {
  11. return (
  12. <>
  13. <Title>AI Model Usage Rankings | OpenCode Data</Title>
  14. <Meta
  15. name="description"
  16. content="Explore OpenCode Go usage across AI models, including token volume, rankings, market share, token pricing, session cost, cache ratio, and geo breakdowns."
  17. />
  18. </>
  19. )
  20. }
  21. export default function App() {
  22. return (
  23. <Router
  24. base={import.meta.env.BASE_URL.replace(/\/$/, "")}
  25. explicitLinks={true}
  26. transformUrl={stripLocaleDataPrefix}
  27. root={(props) => (
  28. <MetaProvider>
  29. <AppMeta />
  30. <Suspense>{props.children}</Suspense>
  31. </MetaProvider>
  32. )}
  33. >
  34. <FileRoutes />
  35. </Router>
  36. )
  37. }