import cn from "classnames";
import DotCmsImage from "./dotcms-image";
import Link from "next/link";
export const Bold = ({ children }) => {children};
export const Italic = ({ children }) => {children};
export const Strike = ({ children }) => {children};
export const Underline = ({ children }) => {children};
export const DotLink = ({ attrs: { href, target }, children }) => {
const regEx = /https?:\/\//;
return regEx.test(href) ? (
{children}
) : (
{children}
);
};
const nodeMarks = {
link: DotLink,
bold: Bold,
underline: Underline,
italic: Italic,
strike: Strike,
};
export const TextNode = (props) => {
const { marks = [], text } = props;
const mark = marks[0] || { type: "", attrs: {} };
const newProps = { ...props, marks: marks.slice(1) };
const Component = nodeMarks[mark?.type];
if (!Component) {
return text;
}
return (
{children}
; }; export const BulletList = ({ children }) => { return{children}; }; export const CodeBlock = ({ language, children }) => { return (
{children}
);
};