import { NextPageContext } from 'next' import { Box, Card, Flex, Heading } from 'theme-ui' import AttributeIcon from '../../../../components/v2-pre/AttributeIcon' import AvatarFigureImage from '../../../../components/v2-pre/AvatarFigureImage' import AvatarSkillIcon from '../../../../components/v2-pre/AvatarSkillIcon' import AvatarSubSkillIcon from '../../../../components/v2-pre/AvatarSubSkillIcon' import BattlesuitAvatarIcon from '../../../../components/v2-pre/BattlesuitAvatarIcon' import FormattedText from '../../../../components/v2-pre/FormattedText' import { formatSkillInfo, formatSubSkillInfo } from '../../../../lib/v2-pre/data/formatText' import { loadBattlesuitCatalog, loadBattlesuitData } from '../../../../lib/v2-pre/server/loadData' import { Battlesuit, SkillTagItem } from '../../../../lib/v2-pre/data/types' import { Fragment } from 'react' import TagIcon from '../../../../components/v2-pre/TagIcon' import { getAttributeLabel, getCharacterTypeLabel, getSkillTypeLabel, getTagTypeLabel, getWeaponTypeLabel } from '../../../../lib/v2-pre/data/text' import StarIcon from '../../../../components/v2-pre/StarIcon' import ChibiIcon from '../../../../components/v2-pre/ChibiIcon' import WeaponTypeIcon from '../../../../components/v2-pre/WeaponTypeIcon' import { sortBattlesuitSkill } from '../../../../lib/v2-pre/data/utils' interface BattlesuitShowPageProps { battlesuit: Battlesuit } const BattlesuitShowPage = ({ battlesuit }: BattlesuitShowPageProps) => { return ( {battlesuit.fullName} {getCharacterTypeLabel(battlesuit.character)} {getAttributeLabel(battlesuit.attributeType)} {getWeaponTypeLabel(battlesuit.weapon)} {battlesuit.tags.map(tag => { return ( {getTagTypeLabel(tag)} ) })} Skills {battlesuit.skills.sort(sortBattlesuitSkill).map(skill => { return ( {skill.name} {skill.tags.length > 0 && ( {skill.tags.map((tag, index) => { return })} )} {getSkillTypeLabel(skill.skillType)} {formatSkillInfo(skill)} {skill.subSkills.map(subSkill => { return ( {subSkill.name} {subSkill.unlockStar.localeCompare(battlesuit.initialStar) > 0 && ( )} {subSkill.tags.length > 0 && ( {subSkill.tags.map((tag, index) => { return })} )} {formatSubSkillInfo(subSkill)} ) })} ) })} {/*
{JSON.stringify(battlesuit, null, 2)}
*/}
) } export default BattlesuitShowPage export async function getStaticProps({ locale, params }: NextPageContext & { params: { battlesuitId: string } }) { const battlesuit = loadBattlesuitData(params.battlesuitId) return { props: { battlesuit } } } export async function getStaticPaths() { const battlesuitCatalog = loadBattlesuitCatalog() return { paths: battlesuitCatalog.map(catalogItem => { return { params: { battlesuitId: catalogItem.id } } }), fallback: false } } interface SkillTagBoxProps { tag: SkillTagItem } const SkillTagItem = ({ tag }: SkillTagBoxProps) => { return }