import { cn } from '@/lib/utils' import { colors, surfaces, effects } from '@/lib/theme' import type { DocItem } from '@/lib/docs/types' import CodeBlock from './CodeBlock' import TypeLink from './TypeLink' import { ExternalLink, TriangleAlert } from 'lucide-react' import ReactMarkdown from 'react-markdown' import remarkGfm from 'remark-gfm' interface TypeDocProps { item: DocItem className?: string availableTypeIds?: Set } export default function TypeDoc({ item, className, availableTypeIds }: TypeDocProps) { return (
{/* Header */}

{item.name}

{item.kind} {item.category} {item.deprecated && ( Deprecated )}
{item.description && (

{item.description}

)}
{item.source && ( { e.currentTarget.style.borderColor = colors.borders.hover e.currentTarget.style.color = colors.text.secondary }} onMouseLeave={(e) => { e.currentTarget.style.borderColor = colors.borders.default e.currentTarget.style.color = colors.text.muted }} > Source )}
{/* Remarks */} {item.remarks && (

Remarks

{item.remarks}
)} {/* Type Definition */} {item.signature && (

Definition

)} {/* Interface Properties */} {item.kind === 'interface' && item.parameters && item.parameters.length > 0 && (

Properties

{item.parameters.map((prop, index) => ( ))}
Property Type Description
{prop.name} {prop.optional && ( ? )} {prop.description || '—'} {prop.defaultValue && (
Default: {prop.defaultValue}
)}
)} {/* Examples */} {item.examples && item.examples.length > 0 && (

Examples

{item.examples.map((example, index) => ( ))}
)} {/* Tags */} {item.tags && item.tags.length > 0 && (
{item.tags.map((tag) => ( {tag} ))}
)} {/* See Also */} {item.see && item.see.length > 0 && (

See Also

{item.see.map((ref, index) => (
{ref}
))}
)}
) }