import * as React from 'react'; import { useIntl } from 'react-intl'; import { Card, Row, Col } from 'antd'; import { useSiteData } from './util'; import './MorePage.less'; type SourceType = 'zhihu' | 'yuque'; type Icons = Record; interface MoreProps { title: string; description: string; date: string; img: string; source: SourceType; href: string; icons?: Icons; loading?: boolean; } const MoreCard = ({ title, description, date, img, source, href, icons, loading }: MoreProps) => { return ( { window?.gtag('event', '点击', { event_category: '首页文章', event_label: href, }); }} > } loading={loading} className="more-card" >
{date} {icons ? {source} : null}
); }; export default function MorePage() { const { locale } = useIntl(); const isZhCN = locale === 'zh-CN'; const list = useSiteData('extras', isZhCN ? 'cn' : 'en'); const icons = useSiteData('icons'); const loadingProps = { loading: true } as MoreProps; return ( {(list || [loadingProps, loadingProps, loadingProps, loadingProps]).map(more => ( ))} ); }