docs: add workflow and js sdk reference pages for commerce modules (#10898)
* docs: add workflow and js sdk reference pages for commerce modules * resolve build errors
This commit is contained in:
@@ -5,13 +5,22 @@ import clsx from "clsx"
|
||||
type CardListProps = {
|
||||
items: CardProps[]
|
||||
itemsPerRow?: number
|
||||
defaultItemsPerRow?: number
|
||||
className?: string
|
||||
}
|
||||
|
||||
export const CardList = ({ items, itemsPerRow, className }: CardListProps) => {
|
||||
export const CardList = ({
|
||||
items,
|
||||
itemsPerRow,
|
||||
className,
|
||||
defaultItemsPerRow,
|
||||
}: CardListProps) => {
|
||||
if (!itemsPerRow) {
|
||||
// if length of items is even, set to `2`, else set to `3`
|
||||
itemsPerRow = items.length === 1 ? 0 : items.length % 2 === 0 ? 2 : 3
|
||||
itemsPerRow =
|
||||
items.length === 1
|
||||
? 1
|
||||
: defaultItemsPerRow || (items.length % 2 === 0 ? 2 : 3)
|
||||
}
|
||||
return (
|
||||
<section
|
||||
|
||||
Reference in New Issue
Block a user