2024-01-31 22:25:24 +08:00

20 lines
431 B
TypeScript

import { Node } from "@/types/node";
import Renderer from "./Renderer";
import { BaseProps } from "./types";
interface Props extends BaseProps {
children: Node[];
}
const Paragraph: React.FC<Props> = ({ children }: Props) => {
return (
<p>
{children.map((child, index) => (
<Renderer key={`${child.type}-${index}`} index={String(index)} node={child} />
))}
</p>
);
};
export default Paragraph;