src/components/fancy-heading.tsximport { Heading } from '@/components/heading'import { Accent } from '@/components/accent'import clsx from 'clsx'interface FancyHeadingProps {text: stringaccent: stringclassName?: stringid?: stringas?: 'h1' | 'h2'margin?: string}// Helper function to generate a valid ID from textfunction generateId(text: string, accent: string): string {const combined = `${text} ${accent}`const processed = combined.toLowerCase().replace(/[^\w\s-]/g, '') // Remove special characters except spaces and hyphens.replace(/\s+/g, '-') // Replace spaces with hyphens
Showing the first 20 lines.
Get full code