import { ArrowRightOutlined } from '@ant-design/icons'; import { Tag } from 'antd'; import { history, Link } from 'dumi'; import { type FC } from 'react'; import { Center, Flexbox } from 'react-layout-kit'; import { IFeature } from '../../types'; import { useStyles } from './Item.style'; const Image: FC<{ image: string; className?: string; title: string }> = ({ image, className, title, }) => { // 正则匹配图片资源 const reg = /(\.png|\.jpg|\.jpeg|\.gif|\.svg|\.webp)$/; return image.startsWith('http') || reg.test(image) ? ( {title} ) : (
{image}
); }; const FeatureItem: FC = ({ imageType, row, column, hero, description, image, title, link, imageStyle, openExternal, }) => { const rowNum = row || 7; const { styles, theme } = useStyles({ rowNum, hasLink: !!link }); return (
{ if (!link) return; if (openExternal) { window.open(link); } else { history.push(link); } }} >
{image && (
)} {title && ( {title} {imageType === 'soon' ? ( SOON ) : null} )} {description && (

)} {link && (

立即了解
)}
{hero &&
}
); }; export default FeatureItem;