diff options
| author | Armand Philippot <git@armandphilippot.com> | 2022-05-23 14:07:02 +0200 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2022-05-23 16:00:13 +0200 |
| commit | 34e216546151eaf8a0a3cbb0bc8b65dae4c63bf2 (patch) | |
| tree | bff34f8a1dc65f0559ddf851433f242edb092824 /src/components/organisms/layout/cards-list.tsx | |
| parent | 0f8f963ba3eccd7fd94785bf7fb216b6287cec57 (diff) | |
refactor: reduce the number of data transformation
Diffstat (limited to 'src/components/organisms/layout/cards-list.tsx')
| -rw-r--r-- | src/components/organisms/layout/cards-list.tsx | 36 |
1 files changed, 14 insertions, 22 deletions
diff --git a/src/components/organisms/layout/cards-list.tsx b/src/components/organisms/layout/cards-list.tsx index 0168bb2..1feddd0 100644 --- a/src/components/organisms/layout/cards-list.tsx +++ b/src/components/organisms/layout/cards-list.tsx @@ -10,32 +10,24 @@ export type CardsListItem = Omit< CardProps, 'className' | 'coverFit' | 'titleLevel' > & { - id: string; -}; - -export type CardsListProps = { - /** - * Set additional classnames to the list wrapper. - */ - className?: string; - /** - * The cover fit. - */ - coverFit?: CardProps['coverFit']; /** - * The cards data. + * The card id. */ - items: CardsListItem[]; - /** - * The list kind. Either ordered or unordered. - */ - kind?: ListProps['kind']; - /** - * The title level (hn). - */ - titleLevel: CardProps['titleLevel']; + id: string; }; +export type CardsListProps = Pick<CardProps, 'coverFit' | 'titleLevel'> & + Pick<ListProps, 'kind'> & { + /** + * Set additional classnames to the list wrapper. + */ + className?: string; + /** + * The cards data. + */ + items: CardsListItem[]; + }; + /** * CardsList component * |
