feat(org): Ported apikeys and bookmarks to new inputs
This commit is contained in:
parent
545f829a6a
commit
dc7a0316c2
16 changed files with 230 additions and 48 deletions
30
sites/shared/hooks/use-apikey-docs.mjs
Normal file
30
sites/shared/hooks/use-apikey-docs.mjs
Normal file
|
@ -0,0 +1,30 @@
|
|||
// Hooks
|
||||
import { useCallback } from 'react'
|
||||
import { useDynamicMdx } from 'shared/hooks/use-dynamic-mdx.mjs'
|
||||
// Components
|
||||
import { MdxWrapper } from 'shared/components/wrappers/mdx.mjs'
|
||||
|
||||
export const useApikeyDocs = (locale) => {
|
||||
const loader = (option) =>
|
||||
useCallback(
|
||||
() =>
|
||||
import(
|
||||
/* webpackInclude: /docs\/site\/apikeys\/[a-z]+\/[a-z][a-z]\.md$/ */ `markdown/docs/site/apikeys//${option}/${locale}.md`
|
||||
),
|
||||
[locale]
|
||||
)
|
||||
|
||||
const docs = {}
|
||||
|
||||
for (const option of ['name', 'expiry', 'level']) {
|
||||
const { MDX, frontmatter } = useDynamicMdx(loader(option))
|
||||
docs[option] = (
|
||||
<>
|
||||
<h2>{frontmatter.title}</h2>
|
||||
<MdxWrapper>{MDX}</MdxWrapper>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
return docs
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue