import React from "react"; import cn from "./TocCard.module.css"; import { Icon } from "../../../writer"; interface TocCardProps { title: string; description: string; href: string; className?: string; icon?: string; as?: React.ElementType; } export function TocCard({ title, description, href, className, icon, as }: TocCardProps) { const Link = as || $Link; return
{title}
{icon && }
{description}
} function $Link({ children, href, ...props }: React.ComponentProps<'a'>) { return {children} }