diff options
Diffstat (limited to 'src/components/molecules/grid/grid.tsx')
| -rw-r--r-- | src/components/molecules/grid/grid.tsx | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/src/components/molecules/grid/grid.tsx b/src/components/molecules/grid/grid.tsx index ca920f8..3d0ecf1 100644 --- a/src/components/molecules/grid/grid.tsx +++ b/src/components/molecules/grid/grid.tsx @@ -5,19 +5,18 @@ import { type CSSProperties, } from 'react'; import type { Spacing } from '../../../types'; -import { List, ListItem, type ListProps } from '../../atoms'; +import { List, type ListProps } from '../../atoms'; import styles from './grid.module.scss'; -export type GridItem = { - id: string; - item: ReactNode; -}; - export type GridProps<T extends boolean> = Omit< ListProps<T, false>, 'children' | 'hideMarker' | 'isHierarchical' | 'isInline' | 'spacing' > & { /** + * The grid items. + */ + children: ReactNode; + /** * Control the number of column. * * @default 'auto-fit' @@ -36,10 +35,6 @@ export type GridProps<T extends boolean> = Omit< */ isCentered?: boolean; /** - * The grid items. - */ - items: GridItem[]; - /** * Define a fixed size for each item. * * You should either use `size` or `sizeMax`/`sizeMin` not both. @@ -67,11 +62,11 @@ export type GridProps<T extends boolean> = Omit< const GridWithRef = <T extends boolean>( { + children, className = '', col = 'auto-fit', gap, isCentered = false, - items, size, sizeMax, sizeMin, @@ -104,11 +99,7 @@ const GridWithRef = <T extends boolean>( ref={ref} style={gridStyles} > - {items.map(({ id, item }) => ( - <ListItem className={styles.item} key={id}> - {item} - </ListItem> - ))} + {children} </List> ); }; |
