import React from 'react'; import classNames from 'classnames'; import { Link } from 'gatsby'; import { useTranslation } from 'react-i18next'; import styles from './NavigatorBanner.module.less'; interface NavigatorBannerProps { post?: any; type: 'prev' | 'next'; } const NavigatorBanner: React.FC = ({ post, type }) => { const { t } = useTranslation(); if (!post) { return
; } const { node: { fields: { slug }, frontmatter: { title }, }, } = post; return (
{t(type === 'prev' ? '上一篇' : '下一篇')}
{title}
); }; export default NavigatorBanner;