mirror of
https://github.com/supabase/supabase.git
synced 2026-10-05 17:35:10 +03:00
* Bump nodemailer.
* Bump body-parser.
* Bump node-forge.
* Remove unused dep remark-html.
* Bump some deps for mdast-util-to-hast.
* Bump glob.
* Bump valibot.
* Bump @modelcontextprotocol/sdk and dedupe @supabase/mcp-utils.
* Bump @vitejs/plugin-rsc.
* Bump contentlayer2.
* Revert "Bump contentlayer2."
This reverts commit cb53f32a6a.
* Remove react-docgen since it's unused.
53 lines
1.8 KiB
TypeScript
53 lines
1.8 KiB
TypeScript
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from 'ui'
|
|
|
|
export function ComponentProps(props: any) {
|
|
// map through all props types for this component DropdownMenu
|
|
// return a table with the prop name, type, default value, and description
|
|
|
|
// const code = `
|
|
// /** My first component */
|
|
// export default ({ name }: { name: string }) => <div>{{name}}</div>;
|
|
// `
|
|
|
|
// console.log('from the component props', JSON.parse(props.docs))
|
|
|
|
const docs = JSON.parse(props.docs)
|
|
|
|
// console.log(docs.props)
|
|
|
|
return (
|
|
<div className="space-y-2">
|
|
<p className="font-medium text-foreground-light">{props.children}</p>
|
|
|
|
<Table>
|
|
<TableHeader>
|
|
<TableRow>
|
|
<TableHead className="font-mono uppercase text-xs font-normal">Prop Name</TableHead>
|
|
<TableHead className="font-mono uppercase text-xs font-normal">Required</TableHead>
|
|
<TableHead className="font-mono uppercase text-xs font-normal">Type</TableHead>
|
|
<TableHead className="font-mono uppercase text-xs text-right font-normal">
|
|
Description
|
|
</TableHead>
|
|
</TableRow>
|
|
</TableHeader>
|
|
<TableBody>
|
|
{Object.entries(docs.props).map(([propName, prop], index) => (
|
|
<TableRow key={index}>
|
|
<TableCell>{propName}</TableCell>
|
|
{/*
|
|
// @ts-ignore */}
|
|
<TableCell>{prop.required ? 'Yes' : 'No'}</TableCell>
|
|
{/*
|
|
// @ts-ignore */}
|
|
<TableCell>{prop.flowType.name}</TableCell>
|
|
{/*
|
|
// @ts-ignore */}
|
|
<TableCell className="text-right">{prop.description}</TableCell>
|
|
</TableRow>
|
|
))}
|
|
</TableBody>
|
|
</Table>
|
|
</div>
|
|
)
|
|
}
|