import Page from 'site/components/wrappers/page.js'
import useApp from 'site/hooks/useApp.js'
import Link from 'next/link'
import { useTranslation } from 'next-i18next'
import { formatVersionTitle } from 'site/components/version-picker.js'
import Layout from 'site/components/layouts/bare'
import { PageTitle } from 'shared/components/layouts/default'
import availableVersions from 'site/available-versions.json' assert { type: 'json' }
const DesignLinks = ({ list, prefix='', version=false }) => {
const { t } = useTranslation(['patterns'])
return (
)
}
const PatternListPageTemplate = ({ section=false, version=false }) => {
const app = useApp()
const { t } = useTranslation(['app'])
const title = section
? app.navigation[section].__title
: t('designs')
const sectionDesigns = (section=false, version=false) => {
if (!section) {
const all = []
if (!version || version === 'next') {
for (const section in app.designs) all.push(...app.designs[section])
return all
}
else if (availableVersions[version]) return availableVersions[version]
} else {
if (!version || version === 'next') return app.designs[section]
else if (availableVersions[version]) return availableVersions[version]
}
return []
}
return (
{version && version !== 'next'
? (
)
:
}
)
}
export default PatternListPageTemplate