import * as React from 'react'; import classNames from 'classnames'; import { FormattedMessage, useIntl } from 'react-intl'; import { Row, Col, Typography } from 'antd'; import { useSiteData } from './util'; import type { Recommendation } from './util'; import './RecommendPage.less'; const { Title, Paragraph } = Typography; interface RecommendBlockProps extends Recommendation { main?: boolean; loading?: boolean; } const RecommendBlock = ({ main, title, popularize, description, img, href, loading, }: RecommendBlockProps) => ( { window?.gtag('event', '点击', { event_category: '首页推广', event_label: href, }); }} > {title} {popularize && ( )}
{title} {description}
); export default function RecommendPage() { const { locale } = useIntl(); const [{ recommendations }, loading] = useSiteData(); const list = recommendations?.[locale === 'zh-CN' ? 'cn' : 'en']; const isLoading = loading || !list || list.length === 0; return ( ); }