diff --git a/packages/gazzodown/src/blocks/OrderedListBlock.tsx b/packages/gazzodown/src/blocks/OrderedListBlock.tsx index 6c6fc2734e34b..8eb800ff2f0b7 100644 --- a/packages/gazzodown/src/blocks/OrderedListBlock.tsx +++ b/packages/gazzodown/src/blocks/OrderedListBlock.tsx @@ -7,11 +7,23 @@ type OrderedListBlockProps = { items: MessageParser.ListItem[]; }; +const renderChildren = (children: MessageParser.ListItem[]): ReactElement => ( +
    + {children.map((item, index) => ( +
  1. + {item.value} + {item.children?.length ? renderChildren(item.children) : null} +
  2. + ))} +
+); + const OrderedListBlock = ({ items }: OrderedListBlockProps): ReactElement => ( -
    - {items.map(({ value, number }, index) => ( -
  1. - {value} +
      + {items.map((item, index) => ( +
    1. + {item.value} + {item.children?.length ? renderChildren(item.children) : null}
    2. ))}
    diff --git a/packages/gazzodown/src/blocks/UnorderedListBlock.tsx b/packages/gazzodown/src/blocks/UnorderedListBlock.tsx index 500e525011107..f1f72ee0f035c 100644 --- a/packages/gazzodown/src/blocks/UnorderedListBlock.tsx +++ b/packages/gazzodown/src/blocks/UnorderedListBlock.tsx @@ -7,11 +7,23 @@ type UnorderedListBlockProps = { items: MessageParser.ListItem[]; }; +const renderChildren = (children: MessageParser.ListItem[]): ReactElement => ( + +); + const UnorderedListBlock = ({ items }: UnorderedListBlockProps): ReactElement => ( -