[feature] migrate to monorepo
This commit is contained in:
commit
05ddc1f783
267 changed files with 75165 additions and 0 deletions
30
frontend/src/pages/Article.tsx
Normal file
30
frontend/src/pages/Article.tsx
Normal file
|
@ -0,0 +1,30 @@
|
|||
import { useParams } from 'react-router-dom';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useState, useEffect } from 'react';
|
||||
|
||||
export default function Article() {
|
||||
const { articleId } = useParams();
|
||||
const { i18n } = useTranslation();
|
||||
const [article, setArticle] = useState<{
|
||||
content: string;
|
||||
metadata: any;
|
||||
} | null>(null);
|
||||
|
||||
useEffect(() => {
|
||||
// In a real application, we would fetch the article content here
|
||||
// based on the articleId and current language
|
||||
console.log(`Fetching article ${articleId} in ${i18n.language}`);
|
||||
}, [articleId, i18n.language]);
|
||||
|
||||
if (!article) {
|
||||
return <div>Loading...</div>;
|
||||
}
|
||||
|
||||
return (
|
||||
<article className="max-w-4xl mx-auto">
|
||||
<div className="prose dark:prose-invert max-w-none">
|
||||
<div dangerouslySetInnerHTML={{ __html: article.content }} />
|
||||
</div>
|
||||
</article>
|
||||
);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue