import CustomCodeBlock from "../CustomCodeBlock/CustomCodeBlock"

type CustomPreBlockProps = {
    children: JSX.Element | JSX.Element[]
}

const CustomPreBlock = ({children, ...rest}: CustomPreBlockProps): JSX.Element => {
    if ("type" in children && children["type"] === "code") {
        return CustomCodeBlock({children: children["props"]["children"], className: children["props"]["className"] });
    }
    
    return <pre {...rest}>{children}</pre>
}
export default CustomPreBlock;