import React from 'react'; import classNames from 'classnames'; import { Link } from 'gatsby'; import { useTranslation } from 'react-i18next'; import styles from './NavigatorBanner.module.less'; export interface NavigatorBannerProps { post?: { slug?: string; title?: string; }; type: 'prev' | 'next'; } const NavigatorBanner: React.FC = ({ post, type }) => { const { t } = useTranslation(); if (!post) { return
; } const { slug, title } = post; if (!slug || !title) { return null; } return (
{type === 'prev' && '<'} {title} {type === 'next' && '>'}
); }; export default NavigatorBanner;