|
1 | | -import { Text, VStack } from '@devup-ui/react' |
| 1 | +import { Box, Text, VStack } from '@devup-ui/react' |
2 | 2 | import Markdown from 'react-markdown' |
3 | 3 |
|
4 | 4 | import { _components } from '@/mdx-components' |
@@ -41,50 +41,52 @@ export const PropsTable = async (props: PropTableProps) => { |
41 | 41 | const { componentProps } = props |
42 | 42 |
|
43 | 43 | return ( |
44 | | - <Table border={0}> |
45 | | - <TableHead> |
46 | | - <TableRow> |
47 | | - <TableHeaderCell>Prop</TableHeaderCell> |
48 | | - <TableHeaderCell>description</TableHeaderCell> |
49 | | - <TableHeaderCell>Type</TableHeaderCell> |
50 | | - <TableHeaderCell>Default</TableHeaderCell> |
51 | | - </TableRow> |
52 | | - </TableHead> |
53 | | - <TableBody> |
54 | | - {componentProps.length === 0 && ( |
| 44 | + <Box maxWidth="100%" overflow="auto" width="100%"> |
| 45 | + <Table border={0} style={{ minWidth: '600px' }}> |
| 46 | + <TableHead> |
55 | 47 | <TableRow> |
56 | | - <TableCell colSpan={3}> |
57 | | - <Text>No props to display</Text> |
58 | | - </TableCell> |
| 48 | + <TableHeaderCell>Prop</TableHeaderCell> |
| 49 | + <TableHeaderCell>description</TableHeaderCell> |
| 50 | + <TableHeaderCell>Type</TableHeaderCell> |
| 51 | + <TableHeaderCell>Default</TableHeaderCell> |
59 | 52 | </TableRow> |
60 | | - )} |
61 | | - {componentProps.map( |
62 | | - ({ property, description, type, default: defaultValue }) => ( |
63 | | - <TableRow key={property}> |
64 | | - <TableCell> |
65 | | - <Text typography="bodyBold">{property}</Text> |
| 53 | + </TableHead> |
| 54 | + <TableBody> |
| 55 | + {componentProps.length === 0 && ( |
| 56 | + <TableRow> |
| 57 | + <TableCell colSpan={3}> |
| 58 | + <Text>No props to display</Text> |
66 | 59 | </TableCell> |
67 | | - <TableCell> |
68 | | - <MdxComponentsWithCodeBlock> |
69 | | - {description} |
70 | | - </MdxComponentsWithCodeBlock> |
71 | | - </TableCell> |
72 | | - <TableCell> |
73 | | - <VStack> |
| 60 | + </TableRow> |
| 61 | + )} |
| 62 | + {componentProps.map( |
| 63 | + ({ property, description, type, default: defaultValue }) => ( |
| 64 | + <TableRow key={property}> |
| 65 | + <TableCell> |
| 66 | + <Text typography="bodyBold">{property}</Text> |
| 67 | + </TableCell> |
| 68 | + <TableCell> |
74 | 69 | <MdxComponentsWithCodeBlock> |
75 | | - {type?.replaceAll('"', "'")} |
| 70 | + {description} |
76 | 71 | </MdxComponentsWithCodeBlock> |
77 | | - </VStack> |
78 | | - </TableCell> |
79 | | - <TableCell> |
80 | | - <MdxComponentsWithCodeBlock> |
81 | | - {defaultValue} |
82 | | - </MdxComponentsWithCodeBlock> |
83 | | - </TableCell> |
84 | | - </TableRow> |
85 | | - ), |
86 | | - )} |
87 | | - </TableBody> |
88 | | - </Table> |
| 72 | + </TableCell> |
| 73 | + <TableCell> |
| 74 | + <VStack> |
| 75 | + <MdxComponentsWithCodeBlock> |
| 76 | + {type?.replaceAll('"', "'")} |
| 77 | + </MdxComponentsWithCodeBlock> |
| 78 | + </VStack> |
| 79 | + </TableCell> |
| 80 | + <TableCell> |
| 81 | + <MdxComponentsWithCodeBlock> |
| 82 | + {defaultValue} |
| 83 | + </MdxComponentsWithCodeBlock> |
| 84 | + </TableCell> |
| 85 | + </TableRow> |
| 86 | + ), |
| 87 | + )} |
| 88 | + </TableBody> |
| 89 | + </Table> |
| 90 | + </Box> |
89 | 91 | ) |
90 | 92 | } |
0 commit comments