2024-02-28 21:02:05 +03:00
|
|
|
import React, { type FC } from 'react';
|
2024-01-31 04:25:14 +03:00
|
|
|
import classNames from 'classnames';
|
|
|
|
import { getDefaultBackgroundClass } from '../cardBuilderUtils';
|
|
|
|
import CardImageContainer from './CardImageContainer';
|
|
|
|
|
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';
|
|
|
|
|
|
|
|
interface CardContentProps {
|
|
|
|
item: ItemDto;
|
|
|
|
cardOptions: CardOptions;
|
|
|
|
coveredImage: boolean;
|
|
|
|
overlayText: boolean | undefined;
|
|
|
|
imgUrl: string | undefined;
|
|
|
|
blurhash: string | undefined;
|
|
|
|
forceName: boolean;
|
|
|
|
}
|
|
|
|
|
|
|
|
const CardContent: FC<CardContentProps> = ({
|
|
|
|
item,
|
|
|
|
cardOptions,
|
|
|
|
coveredImage,
|
|
|
|
overlayText,
|
|
|
|
imgUrl,
|
|
|
|
blurhash,
|
|
|
|
forceName
|
|
|
|
}) => {
|
|
|
|
const cardContentClass = classNames(
|
|
|
|
'cardContent',
|
|
|
|
{ [getDefaultBackgroundClass(item.Name)]: !imgUrl }
|
|
|
|
);
|
|
|
|
|
|
|
|
return (
|
|
|
|
<div
|
2024-02-01 19:41:08 +03:00
|
|
|
className={cardContentClass}
|
2024-01-31 04:25:14 +03:00
|
|
|
>
|
|
|
|
<CardImageContainer
|
|
|
|
item={item}
|
|
|
|
cardOptions={cardOptions}
|
|
|
|
coveredImage={coveredImage}
|
|
|
|
overlayText={overlayText}
|
|
|
|
imgUrl={imgUrl}
|
|
|
|
blurhash={blurhash}
|
|
|
|
forceName={forceName}
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default CardContent;
|