aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/organisms/layout/cards-list.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/organisms/layout/cards-list.tsx')
-rw-r--r--src/components/organisms/layout/cards-list.tsx25
1 files changed, 11 insertions, 14 deletions
diff --git a/src/components/organisms/layout/cards-list.tsx b/src/components/organisms/layout/cards-list.tsx
index 29add3b..4f920e8 100644
--- a/src/components/organisms/layout/cards-list.tsx
+++ b/src/components/organisms/layout/cards-list.tsx
@@ -1,16 +1,20 @@
-import type { FC } from 'react';
+import type { FC, ReactElement } from 'react';
import { List, ListItem } from '../../atoms';
-import { Card, type CardProps } from '../../molecules';
+import type { CardProps } from '../../molecules';
import styles from './cards-list.module.scss';
-export type CardsListItem = Omit<CardProps, 'className' | 'titleLevel'> & {
+export type CardsListItem = {
+ /**
+ * The card.
+ */
+ card: ReactElement<CardProps<string> | CardProps<undefined>>;
/**
* The card id.
*/
id: string;
};
-export type CardsListProps = Pick<CardProps, 'titleLevel'> & {
+export type CardsListProps = {
/**
* Set additional classnames to the list wrapper.
*/
@@ -36,7 +40,6 @@ export const CardsList: FC<CardsListProps> = ({
className = '',
isOrdered = false,
items,
- titleLevel,
}) => {
const kindModifier = `wrapper--${isOrdered ? 'ordered' : 'unordered'}`;
@@ -47,15 +50,9 @@ export const CardsList: FC<CardsListProps> = ({
isInline
isOrdered={isOrdered}
>
- {items.map(({ id, ...item }) => (
- <ListItem key={id}>
- <Card
- {...item}
- className={styles.card}
- key={id}
- id={id}
- titleLevel={titleLevel}
- />
+ {items.map(({ id, card }) => (
+ <ListItem className={styles.item} key={id}>
+ {card}
</ListItem>
))}
</List>