pull/4992/merge
Sara Vieira 2 weeks ago committed by GitHub
commit 0b2ae6067d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -1,3 +1,4 @@
import { useMemo } from "react";
import { Node } from "@/types/proto/api/v1/markdown_service";
import Renderer from "./Renderer";
import { BaseProps } from "./types";
@ -8,9 +9,19 @@ interface Props extends BaseProps {
children: Node[];
}
const OrderedListItem: React.FC<Props> = ({ children }: Props) => {
const OrderedListItem: React.FC<Props> = ({ children, number }: Props) => {
const ml = useMemo(
() =>
number.length > 1
? {
marginLeft: 8 * (number.length - 1),
}
: {},
[number],
);
return (
<li>
<li style={ml}>
{children.map((child, index) => (
<Renderer key={`${child.type}-${index}`} index={String(index)} node={child} />
))}

Loading…
Cancel
Save