diff --git a/frontend/src/components/WikiBody.tsx b/frontend/src/components/WikiBody.tsx
index d3d707f..30727c7 100644
--- a/frontend/src/components/WikiBody.tsx
+++ b/frontend/src/components/WikiBody.tsx
@@ -1,13 +1,14 @@
import ReactMarkdown from 'react-markdown'
import { Link } from 'react-router-dom'
-type Props = { body: string }
+type Props = { title: string
+ body?: string }
-export default ({ body }: Props) => (
+export default ({ title, body }: Props) => (
(['/', '.'].some (e => href?.startsWith (e))
- ? {children}
- : {children})) }}>
- {body}
+ ({ href, children }) => (['/', '.'].some (e => href?.startsWith (e))
+ ? {children}
+ : {children})) }}>
+ {body || `このページは存在しません。[新規作成してください](/wiki/new?title=${ encodeURIComponent (title) })。`}
)
diff --git a/frontend/src/components/common/TabGroup.tsx b/frontend/src/components/common/TabGroup.tsx
index 4444b23..fd15549 100644
--- a/frontend/src/components/common/TabGroup.tsx
+++ b/frontend/src/components/common/TabGroup.tsx
@@ -2,8 +2,8 @@ import React, { useState } from 'react'
import { cn } from '@/lib/utils'
type TabProps = { name: string
- init?: boolean
- children: React.ReactNode }
+ init?: boolean
+ children: React.ReactNode }
type Props = { children: React.ReactNode }
@@ -20,20 +20,20 @@ export default ({ children }: Props) => {
return (
-
-
- {tabs[current]}
-
+
+
+ {tabs[current]}
+
)
}
diff --git a/frontend/src/pages/posts/PostListPage.tsx b/frontend/src/pages/posts/PostListPage.tsx
index e535138..95003b5 100644
--- a/frontend/src/pages/posts/PostListPage.tsx
+++ b/frontend/src/pages/posts/PostListPage.tsx
@@ -129,11 +129,11 @@ export default () => {
{loading && 'Loading...'}
- {(wikiPage && wikiPage.body) && (
-
-
+ {tags.length === 1 && (
+
+
-
+
Wiki を見る
diff --git a/frontend/src/pages/wiki/WikiDetailPage.tsx b/frontend/src/pages/wiki/WikiDetailPage.tsx
index 39b781d..be69f59 100644
--- a/frontend/src/pages/wiki/WikiDetailPage.tsx
+++ b/frontend/src/pages/wiki/WikiDetailPage.tsx
@@ -123,7 +123,7 @@ export default () => {
{wikiPage === undefined
? 'Loading...'
- : }
+ : }
{(!(version) && posts.length > 0) && (