'use client' import {ElementType, ReactNode, useEffect, useRef} from 'react' import {createSlug} from '@/lib/createSlug' import Link from 'next/link' type HeadingProps = { as?: ElementType children: ReactNode } export function Heading({as: Component = 'h1', children = null}: HeadingProps) { const ref = useRef(null) const headingText = children?.toString() || '' useEffect(() => { if (ref.current) { ref.current.innerHTML = '#' } }, []) return ( {children} ) }