The Node.js® Website
at main 909 B view raw
1'use client'; 2 3import { RssIcon } from '@heroicons/react/24/solid'; 4import { useTranslations } from 'next-intl'; 5import type { FC } from 'react'; 6 7import Link from '@/components/Link'; 8import { siteConfig } from '@/next.json.mjs'; 9 10import styles from './index.module.css'; 11 12type BlogHeaderProps = { 13 category: string; 14}; 15 16const BlogHeader: FC<BlogHeaderProps> = ({ category }) => { 17 const t = useTranslations(); 18 const currentFile = 19 siteConfig.rssFeeds.find(item => item.category === category)?.file ?? 20 'blog.xml'; 21 22 return ( 23 <header className={styles.blogHeader}> 24 <h1> 25 {t('layouts.blog.title')} 26 <Link 27 href={`/feed/${currentFile}`} 28 aria-label={t('components.blog.blogHeader.rssLink')} 29 > 30 <RssIcon /> 31 </Link> 32 </h1> 33 <p>{t('components.blog.blogHeader.subtitle')}</p> 34 </header> 35 ); 36}; 37 38export default BlogHeader;