docs: move edit date to footer (#11667)

* docs: move edit date to footer

* fix build error
This commit is contained in:
Shahed Nasser authored and GitHub committed 2025-02-28 16:27:42 +02:00
1 parent 228b7b608d
commit bf67f69f45
23 files changed
+183 -121

No files matched your search

@@ -2,16 +2,27 @@
import { EditButton as UiEditButton } from "docs-ui"
import { usePathname } from "next/navigation"
import { useMemo } from "react"
import { generatedEditDates } from "../../generated/edit-dates.mjs"
const EditButton = () => {
const pathname = usePathname()
const editDate = useMemo(
() =>
(generatedEditDates as Record<string, string>)[
`app${pathname.replace(/\/$/, "")}/page.mdx`
],
[pathname]
)
return (
<UiEditButton
filePath={`/www/apps/user-guide/app${pathname.replace(
/\/$/,
""
)}/page.mdx`}
editDate={editDate}
/>
)
}