Files
punktfunk/docs-site/src/components/Footer.tsx
T
enricobuehler 8402f1ed4d refactor(docs): use shared @unom/app-ui/footer component
The docs footer was a hand-maintained mirror of the marketing site's. Both now
render the same @unom/app-ui/footer component, so they stay in sync. The shared
view themes itself through @unom/style tokens (which the docs already map onto
their Fumadocs surfaces), and a resolveHref hook rebases root-relative links
onto the marketing-site origin. Footer types now come from the library too.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-28 14:34:45 +00:00

28 lines
901 B
TypeScript

import { getRouteApi } from '@tanstack/react-router'
import { FooterView } from '@unom/app-ui/footer'
const rootApi = getRouteApi('__root__')
// Footer markup is shared with the marketing site via @unom/app-ui so the two
// stay in sync. It themes itself through @unom/style tokens, which the docs map
// onto their Fumadocs surfaces. Root-relative links target the website (the
// docs don't host /legal/* etc.), so rebase them onto its origin.
const SITE_URL = 'https://punktfunk.unom.io'
const resolveHref = (to: string) =>
to.startsWith('/') ? `${SITE_URL}${to}` : to
export default function Footer() {
const { footer } = rootApi.useLoaderData()
return (
<FooterView
sections={footer?.sections}
tagline={footer?.tagline}
socials={footer?.socials}
socialsLabel="Socials"
resolveHref={resolveHref}
className="border-t border-fd-border"
/>
)
}