import { Documentation } from '../utils/doc-utils' import { Link as LinkIcon } from 'react-feather' import Link from 'next/link' import { useRouter } from 'next/router' export interface DocsProps { docs: Documentation braces: boolean assign: boolean } export default function Docs({ docs, braces, assign }: DocsProps) { const router = useRouter() return (
{docs.values.map((doc) => { const target = router.asPath.endsWith(`#${doc.name}`) return (
{braces && ${} {doc.name} {typeof doc.args != 'undefined' && doc.args.length > 0 && ( <> {assign && =} {doc.args.map((arg) => ( {arg} ))} )} {braces && }}
{typeof doc.default != 'undefined' && (
Default:{' '} {doc.default}
)}
) })}
) }