import React from 'react'; import { Link } from 'gatsby'; import styles from './Notification.module.less'; export interface NotificationProps { index?: number; type: string; title: string; date: string; link: string; } const Notification: React.FC = ({ index = 0, type, title, date, link = '', }) => { const children = (
{`${index + 1}`.padStart(2, '0')}

{type} ‧ {title}

{date}

); if (link.startsWith('http')) { return ( {children} ); } return ( {children} ); }; export default Notification;