import { TableHead, TableRow, TableCell, TableBody, } from '@aws-amplify/ui-react'; import { ResponsiveTable, ResponsiveTableCell, } from '@/components/ResponsiveTable'; import { CodeHighlight } from '../CodeHighlight'; interface PropMetaData { name: string; description: string; type: string; } export type ReactPlatform = 'react' | 'react-native' | unknown; interface ReactPropsTableProps { platform?: ReactPlatform; props: ((platform: ReactPlatform) => PropMetaData[]) | PropMetaData[]; } const Row = ({ description, name, type }: PropMetaData) => ( {name} {description} ); export default function ReactPropsTable({ platform, props, }: ReactPropsTableProps) { const rows = (typeof props === 'function' ? props(platform) : props)?.map( Row ); return ( Name Description Type {rows} ); }