Extract StigmataCard

This commit is contained in:
Sakura Knoll
2022-01-02 11:49:24 +09:00 Unverified
parent b3f1d50dbd
commit 6e016f9fdf
2 changed files with 47 additions and 61 deletions
+44
View File
@@ -0,0 +1,44 @@
import { Box, Card, Text } from '@theme-ui/components'
import { StigmataData } from '../../lib/honkai3rd/stigmata'
import PageLink from '../atoms/PageLink'
import SquareImageBox from '../atoms/SquareImageBox'
interface StigmataCardProps {
stigmata: Pick<StigmataData, 'id' | 'name' | 'rarity'>
}
const StigmataCard = ({ stigmata }: StigmataCardProps) => {
return (
<Card
sx={{
width: '120px',
padding: 2,
margin: 2,
}}
>
<PageLink href={`/honkai3rd/stigmata/${stigmata.id}`}>
<SquareImageBox
size={100}
alt={stigmata.name}
src={`/assets/honkai3rd/stigmata/icon-${stigmata.id}.png`}
/>
<Box
sx={{
overflow: 'hidden',
textOverflow: 'ellipsis',
width: '100%',
whiteSpace: 'nowrap',
textAlign: 'center',
}}
>
<Text>{stigmata.name}</Text>
</Box>
<Box sx={{ fontSize: 1, textAlign: 'center' }}>
{'⭐'.repeat(stigmata.rarity)}
</Box>
</PageLink>
</Card>
)
}
export default StigmataCard