import { getComponentProps } from "@/utils/get-component-props" import { Box, Code, Icon, Link, Span, Stack, Table, Text, } from "@chakra-ui/react" import NextLink from "next/link" import { LuMinus } from "react-icons/lu" interface PropTableProps { component: string part?: string omit?: string[] } const stringify = (value: any) => { if (value === "true") return `true` if (value === "false") return `false` return JSON.stringify(value) } export const PropTable = async (props: PropTableProps) => { const properties = getComponentProps(props) if (!properties) return null return ( Prop Default Type {properties.length === 0 && ( No props to display )} {properties.map(([name, property]) => ( {name}{" "} {property.isRequired && ( * )} {property.defaultValue ? ( {stringify(property.defaultValue).replaceAll('"', "'")} ) : ( )} {property.type.replaceAll('"', "'")} {property.description} {name === "asChild" && ( For more details, read our{" "} Composition {" "} guide. )} ))} ) }