parent
74791e1f7d
commit
51a5f570fe
2 changed files with 44 additions and 19 deletions
@ -0,0 +1,30 @@ |
||||
import { Badge, Box, Heading, Link, Text } from '@chakra-ui/react'; |
||||
|
||||
type GuideGridItemProps = { |
||||
title: string; |
||||
subtitle: string; |
||||
date: string; |
||||
isNew?: boolean; |
||||
colorIndex?: number; |
||||
}; |
||||
|
||||
const bgColorList = [ |
||||
'gray.700', |
||||
'purple.800' |
||||
]; |
||||
|
||||
export function GuideGridItem(props: GuideGridItemProps) { |
||||
const { title, subtitle, date, isNew = false, colorIndex = 0 } = props; |
||||
|
||||
return ( |
||||
<Link _hover={{ textDecoration: 'none', transform: 'scale(1.02)' }} as={Box} href='#' shadow='xl' p='20px' |
||||
rounded='10px' bg={bgColorList[colorIndex] ?? bgColorList[0]} flex={1}> |
||||
<Text mb='10px' fontSize='13px' color='gray.400'> |
||||
{isNew && <Badge colorScheme={'yellow'} mr='10px'>New</Badge>} |
||||
{date} |
||||
</Text> |
||||
<Heading color='white' mb={'6px'} fontSize='20px'>{title}</Heading> |
||||
<Text color='gray.300' fontSize='14px'>{subtitle}</Text> |
||||
</Link> |
||||
); |
||||
} |
Loading…
Reference in new issue