/** @jsxImportSource theme-ui */ import { Box, Card, Heading } from '@theme-ui/components' import { NextPageContext } from 'next' import { Flex } from 'theme-ui' import { StigmataCatalogItem } from '../../../lib/v2/data/types' import { loadStigmataCatalog } from '../../../lib/v2/server/loadData' import StigmaIcon from '../../../components/v2/StigmaIcon' import Honkai3rdLayout from '../../../components/layouts/Honkai3rdLayout' import { getI18NProps } from '../../../server/i18n' import { useTranslation } from 'next-i18next' import Breadcrumb from '../../../components/organisms/Breadcrumb' import PageLink from '../../../components/atoms/PageLink' interface StigmataListPageProps { stigmataCatalog: StigmataCatalogItem[] } const StigmataListPage = ({ stigmataCatalog }: StigmataListPageProps) => { const { t } = useTranslation() return ( {t('stigmata-list.stigmata-single')} {t('stigmata-list.show-set-list')} {stigmataCatalog .filter(filterStigmata) .sort(sortStigmata) .map(stigma => { return ( {stigma.name} {/* {stigma.id} */} ) })} ) } export default StigmataListPage export async function getStaticProps({ locale }: NextPageContext) { const stigmataCatalog = loadStigmataCatalog(locale) return { props: { stigmataCatalog, ...(await getI18NProps(locale)) } } } function filterStigmata(weapon: StigmataCatalogItem) { return true } function sortStigmata(a: StigmataCatalogItem, b: StigmataCatalogItem) { let aId = parseInt(a.id) let bId = parseInt(b.id) return bId - aId }