import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import './Contentcard.scss';
import Typography from '../Typography';
const ContentCard = ({ contentHeader, data, maxHeight = '', }) => {
    const normalizeMaxHeightClass = (height) => {
        const num = parseInt(height);
        if (isNaN(num))
            return 'default';
        const rounded = Math.round(num / 100) * 100;
        return Math.min(Math.max(100, rounded), 1000);
    };
    const heightClass = `scrollable-${normalizeMaxHeightClass(maxHeight)}`;
    return (_jsxs("div", { className: "ff-content-card-container", children: [_jsx("div", { className: "ff-content-card-nav", children: _jsx(Typography, { as: "div", fontWeight: 'semi-bold', lineHeight: "35px", children: contentHeader }) }), _jsx("div", { className: `ff-content-card-body scrollable ${heightClass}`, children: Object.entries(data).map(([label, value], index) => (_jsxs("div", { className: "ff-content-card-row", children: [_jsxs(Typography, { fontWeight: "semi-bold", children: [label, ":"] }), _jsx(Typography, { className: "ff-content-card-value", children: value })] }, index + label))) })] }));
};
export default ContentCard;
//# sourceMappingURL=ContentCard.js.map