0
0
mirror of https://github.com/yude-jp/yude.jp synced 2024-12-22 20:20:09 +09:00
yude.jp/pages/hcunews.js

40 lines
1.0 KiB
JavaScript
Raw Normal View History

2021-09-22 07:24:00 +09:00
// Base layout
2021-05-27 10:03:44 +09:00
import Layout from "./components/Layout"
2021-09-22 07:24:00 +09:00
2021-12-11 18:07:22 +09:00
// i18n
import { useTranslation, useLanguageQuery, LanguageSwitcher } from 'next-export-i18n';
// React
2021-05-27 10:03:44 +09:00
import React from "react"
import ReactMarkdown from "react-markdown"
2021-09-22 07:24:00 +09:00
// Markdown
2021-05-27 10:03:44 +09:00
import gfm from 'remark-gfm';
2021-05-27 10:31:55 +09:00
import ja from '../docs/hcunews/ja.md'
import en from '../docs/hcunews/en.md'
2021-05-27 10:03:44 +09:00
2021-09-22 07:24:00 +09:00
export default function HcuNews() {
2021-12-11 18:17:20 +09:00
const { t } = useTranslation();
2021-12-11 18:55:57 +09:00
const [query] = useLanguageQuery();
2021-06-14 12:36:18 +09:00
2021-12-11 19:07:11 +09:00
if (!query) {
return <p>Loading...</p>
} else {
return (
<Layout title={t('hcunews')}>
<div>
<h1>{t('hcunews')}</h1>
{query["lang"] === 'ja' ? (
<ReactMarkdown plugins={[gfm]}>
{ja}
</ReactMarkdown>
) : (
<ReactMarkdown plugins={[gfm]}>
{en}
</ReactMarkdown>
)}
</div>
</Layout>
)
}
}