2024-02-28 21:02:05 +03:00
|
|
|
import React, { type FC } from 'react';
|
2024-01-31 04:25:14 +03:00
|
|
|
import { setCardData } from '../cardBuilder';
|
|
|
|
import Card from './Card';
|
2024-03-03 01:31:35 +03:00
|
|
|
import type { ItemDto } from 'types/base/models/item-dto';
|
2024-01-31 04:25:14 +03:00
|
|
|
import type { CardOptions } from 'types/cardOptions';
|
|
|
|
import '../card.scss';
|
|
|
|
|
|
|
|
interface CardsProps {
|
|
|
|
items: ItemDto[];
|
|
|
|
cardOptions: CardOptions;
|
|
|
|
}
|
|
|
|
|
2024-03-01 21:15:52 +03:00
|
|
|
const Cards: FC<CardsProps> = ({ items, cardOptions }) => {
|
2024-01-31 04:25:14 +03:00
|
|
|
setCardData(items, cardOptions);
|
2024-03-01 21:15:52 +03:00
|
|
|
|
|
|
|
const renderCards = () =>
|
|
|
|
items.map((item) => (
|
|
|
|
<Card key={item.Id} item={item} cardOptions={cardOptions} />
|
|
|
|
));
|
|
|
|
|
|
|
|
return <>{renderCards()}</>;
|
2024-01-31 04:25:14 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
export default Cards;
|