@progress/sitefinity-nextjs-sdk
Version:
Provides OOB widgets developed using the Next.js framework, which includes an abstraction layer for Sitefinity communication. Additionally, it offers an expanded API, typings, and tools for further development and integration.
12 lines (11 loc) • 1.5 kB
JavaScript
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { modifySfUrl } from './common';
export function ContentItemsCardsSection({ sectionData, isLoading, cssClassName }) {
if (isLoading) {
return (_jsx("div", { className: "skeleton-loader d-flex justify-content-center mb-4", children: _jsxs("svg", { width: "915", height: "111", viewBox: "0 0 915 111", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [_jsx("rect", { width: "628", height: "38", fill: "#F0F0F0" }), _jsx("rect", { y: "65", width: "915", height: "16", fill: "#F0F0F0" }), _jsx("rect", { y: "95", width: "696", height: "16", fill: "#F0F0F0" })] }) }));
}
if (!Array.isArray(sectionData) || sectionData.length === 0) {
return null;
}
return (_jsx("section", { className: `container mt-4 mb-4 ${cssClassName}`, children: _jsx("div", { className: "row row-cols-1 row-cols-md-3", children: sectionData.map((item, index) => (_jsx("div", { className: "col mb-4", children: _jsxs("div", { className: "card", children: [_jsx("img", { src: modifySfUrl(item.image?.url), className: "card-img-top", alt: item.title, title: item.title }), _jsxs("div", { className: "card-body", children: [_jsx("h4", { className: "card-title", children: item.title }), _jsx("p", { className: "card-text", children: item.content }), _jsx("a", { href: modifySfUrl(item.url), type: "button", target: "_blank", className: "btn btn-outline-dark", children: "Learn more" })] })] }) }, index))) }) }));
}