import React from "react"; import theme from "mazlo-theme"; import StyleSheet from "../../services/StyleSheet"; import { Text } from "../Text"; import { View } from "../View"; type Props = { children: React.ReactNode; type: "bullet" | "ordered"; }; const ListNode = ({ children, type }: Props) => { const asType = type === "ordered" ? "ol" : "ul"; return ( {React.Children.map(children, (child, index) => { return ( {type === "ordered" ? `${index + 1}.` : "\u2022"} {child} ); })} ); }; const styles = StyleSheet.create({ bullet: { left: 0, position: "absolute", paddingRight: theme.space[1], textAlign: "right", }, }); export default ListNode;