import { configs } from 'shared/designs/index.js' import { useTranslation } from 'next-i18next' import PageLink from 'shared/components/page-link.js' const renderOptions = (groups, pattern, t) => { const list = [] for (let l1 in groups) { let children = [] for (let l2 of groups[l1]) { if (typeof l2 === 'string') { children.push(
  • ) } else { for (let l3 in l2) { let grandchildren = [] for (let l4 of l2[l3]) { grandchildren.push(
  • ) } children.push(
  • {t(`og:${l3}`)}
  • ) } } } list.push(
  • {t(`og:${l1}`)}
  • ) } return } const PatternOptions = ({ pattern, before=null, after=null }) => { const { t } = useTranslation([`o_${pattern}`, 'og']) return (
    {before} {renderOptions(configs[pattern].optionGroups, pattern, t)} {after}
    ) } export default PatternOptions