-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Expand file tree
/
Copy pathindex.tsx
More file actions
36 lines (28 loc) · 941 Bytes
/
index.tsx
File metadata and controls
36 lines (28 loc) · 941 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import { RssIcon } from '@heroicons/react/24/solid';
import { useTranslations } from 'next-intl';
import Link from '#site/components/Link';
import { siteConfig } from '#site/next.json.mjs';
import type { FC } from 'react';
import styles from './index.module.css';
type BlogHeaderProps = { category: string };
const BlogHeader: FC<BlogHeaderProps> = ({ category }) => {
const t = useTranslations();
const feed = siteConfig.rssFeeds.find(item => item.category === category);
const currentFile = feed ? feed.file : 'blog.xml';
return (
<header className={styles.blogHeader}>
<h1>
{t('layouts.blog.title')}
<Link
href={`/feed/${currentFile}`}
locale="en"
aria-label={t('components.blog.blogHeader.rssLink')}
>
<RssIcon />
</Link>
</h1>
<p>{t('components.blog.blogHeader.subtitle')}</p>
</header>
);
};
export default BlogHeader;