design-react-kit
Version:
Componenti React per Bootstrap 5
18 lines • 946 B
JavaScript
import React from 'react';
import classNames from 'classnames';
import { Card as CardBase } from 'reactstrap';
export const Card = ({ tag = 'div', href = undefined, teaser, spacing, noWrapper = false, wrapperClassName, testId, ...attributes }) => {
const wrapperClasses = classNames('card-wrapper', wrapperClassName, {
'card-space': spacing,
'card-teaser-wrapper': teaser
});
const cardClasses = classNames(attributes.className, {
'card-teaser': teaser
});
if (noWrapper) {
return (React.createElement(CardBase, { ...attributes, className: cardClasses, tag: tag, href: tag === 'a' ? href : undefined, "data-testid": testId }));
}
return (React.createElement("div", { className: wrapperClasses, "data-testid": testId },
React.createElement(CardBase, { ...attributes, className: cardClasses, tag: tag, href: tag === 'a' ? href : undefined })));
};
//# sourceMappingURL=Card.js.map