diff --git a/src/pages/honkai3rd/weapons/[weaponId].tsx b/src/pages/honkai3rd/weapons/[weaponId].tsx new file mode 100644 index 00000000..8e5afe2c --- /dev/null +++ b/src/pages/honkai3rd/weapons/[weaponId].tsx @@ -0,0 +1,74 @@ +import { Box, Heading, Image, Paragraph } from '@theme-ui/components' +import { NextPageContext } from 'next' +import React from 'react' +import Breadcrumb from '../../../components/organisms/Breadcrumb' +import Honkai3rdNavigator from '../../../components/organisms/Honkai3rdNavigator' +import { + getWeaponById, + listWeapons, + WeaponData, +} from '../../../data/honkai3rd/weapons' + +interface WeaponShowPageProps { + weapon: WeaponData +} + +const WeaponShowPage = ({ weapon }: WeaponShowPageProps) => { + return ( + + + + + + + {weapon.name} + + + + + Weapon Skills + + {weapon.skills.map((skill) => { + return ( + + {skill.name} + {skill.description} + + ) + })} + + + + ) +} + +export default WeaponShowPage + +export function getStaticProps( + context: NextPageContext & { params: { weaponId: string } } +) { + const weapon = getWeaponById(context.params.weaponId) + return { + props: { weapon }, + } +} + +export async function getStaticPaths() { + return { + paths: listWeapons().map((weapon) => { + return { + params: { weaponId: weapon.id }, + } + }), + fallback: true, + } +} diff --git a/src/pages/honkai3rd/weapons/index.tsx b/src/pages/honkai3rd/weapons/index.tsx index 414a623e..08018291 100644 --- a/src/pages/honkai3rd/weapons/index.tsx +++ b/src/pages/honkai3rd/weapons/index.tsx @@ -50,7 +50,7 @@ const WeaponListPage = ({ weaponDataList }: WeaponListPageProps) => { }} >