import { useState, useEffect } from 'react'
import { siteConfig } from 'site/site.config.mjs'
import { horFlexClasses } from 'shared/utils.mjs'
// List of authors
import { authors as allAuthors } from 'config/authors.mjs'
import { docUpdates } from 'site/prebuild/doc-updates.mjs'
// Hooks
import { useTranslation } from 'next-i18next'
import { EditIcon } from 'shared/components/icons.mjs'
import { useAccount } from 'shared/hooks/use-account.mjs'
// Components
import { PageLink } from 'shared/components/link.mjs'
import { TimeAgo, ns as timeagoNs } from 'shared/components/timeago/index.mjs'
import { BookmarkButton } from 'shared/components/bookmarks.mjs'
export const ns = ['account', timeagoNs]
const PersonList = ({ list }) =>
list ? (
{list.map((id) => (
-
{allAuthors[id] ? (
) : (
{id}
)}
))}
) : null
const CreditsList = ({ updates, frontmatter, locale, t }) => (
{updates.a?.length > 0 ? (
-
{t('authors')}:
) : null}
{frontmatter.maintainers && frontmatter.maintainers.length > 0 ? (
-
{t('maintainers')}:
) : null}
{locale !== 'en' && (
-
{t('translators')}:
{t('learnMore')}
)}
-
{t('lastUpdated')}:
)
export const MdxMetaData = ({ frontmatter, locale, slug }) => {
const { control } = useAccount()
const { t, i18n } = useTranslation('docs')
const [localControl, setLocalControl] = useState(1)
// Prevent hydration issues
useEffect(() => {
setLocalControl(control)
}, [])
const updates = docUpdates[slug] || {}
frontmatter.maintainers = ['joostdecock']
locale = i18n.language
/*
* FIXME
*
* The link to the translator status pages on this page links to
* next.freesewing.org because this content is not available on the current
* freesewing.org.
*/
return (
{localControl > 2 && (
)}
{t('contentsBy')}
)
}