返回 CodeWhale
inline-code.tsx
根目录 / web / components / route / inline-code.tsx
1 import { Fragment } from "react";
2
3 export function InlineCode({ text }: { text: string }) {
4 return (
5 <>
6 {text.split("`").map((part, index) =>
7 index % 2 === 1 ? (
8 <code key={index} className="inline" dir="ltr">
9 {part}
10 </code>
11 ) : (
12 <Fragment key={index}>{part}</Fragment>
13 ),
14 )}
15 </>
16 );
17 }
18
18 lines Plain Text