import React, { type FC, type PropsWithChildren } from 'react'; import { Container, SimpleGrid, Heading, Image, Text, Card, CardBody, Stack, Tag, useColorModeValue } from '@chakra-ui/react'; import { Link } from 'dumi'; import useFeatures from '../../hooks/useFeatures'; import { isOutLink } from '../../factory/tools'; import { MAXW } from '../../constant/config'; const Title: FC> = ({ link, children }) => { if (link) { return isOutLink(link) ? ( {children} ) : ( {children} ); } return <>{children}; }; const Features: FC = () => { const features = useFeatures(); const cardBackground = useColorModeValue('blackAlpha.50', 'gray.700'); const cardIconBackground = useColorModeValue('blackAlpha.50', 'gray.500'); if (!features?.length) return null; return ( {features.map(({ title, description, emoji, icon, link, tag }) => ( {(emoji || icon) && ( {emoji && {emoji}} {icon && ( {description} )} )} {title && ( {title} {tag && ( {tag} )} )} {description && ( )} ))} ); }; export default Features;