This commit is contained in:
2025-06-29 05:21:40 +09:00
parent 934225f9e8
commit 8814be9ee9
4 changed files with 61 additions and 37 deletions
+13
View File
@@ -0,0 +1,13 @@
import ReactMarkdown from 'react-markdown'
import { Link } from 'react-router-dom'
type Props = { body: string }
export default ({ body }: Props) => (
<ReactMarkdown components={{ a: (
({ href, children }) => (['/', '.'].some (e => href?.startsWith (e))
? <Link to={href!}>{children}</Link>
: <a href={href} target="_blank" rel="noopener noreferrer">{children}</a>)) }}>
{body}
</ReactMarkdown>)
+1 -1
View File
@@ -5,7 +5,7 @@ type TabProps = { name: string
init?: boolean
children: React.ReactNode }
type Props = { children: React.ReactElement<{ name: string }>[] }
type Props = { children: React.ReactElement<TabProps>[] }
export const Tab = ({ children }: TabProps) => <>{children}</>