@etsoo/website
Version:
ETSOO CMS Based NextJs Website Framework
25 lines (24 loc) • 1.6 kB
JavaScript
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import React from 'react';
import { CommonPhotosRenderer } from './CommonPhotosRenderer';
import { HtmlContent } from './HtmlContent';
/**
* Common content list tab page
* @param props Props
* @returns Component
*/
export function CommonContentListPage(props) {
// Destruct
const { tab, articles, noDescription, photosRenderer = CommonPhotosRenderer } = props;
const photos = [];
// Layout
return (_jsxs(React.Fragment, { children: [!noDescription && tab.description && (_jsx("div", { className: "tab-description-box text-justify", children: tab.description })), _jsx("div", { className: "container tab-list", children: articles.map((raw) => {
// Type assertion
// Data loaded with StaticTabPage
// withContent: tab.layout === TabLayout.ContentList
const article = raw;
if (article.photos)
photos.push(...article.photos);
return (_jsxs("div", { className: "row", children: [_jsx("div", { className: "col-md-4 tab-list-image", children: _jsx("img", { src: article.logo, className: "img-fluid" }) }), _jsxs("div", { className: "col-md-8 tab-list-container", children: [_jsx("div", { className: "tab-list-title-nolink", children: article.title }), _jsx("div", { className: "text-justify tab-list-description", children: _jsx(HtmlContent, { innerHTML: article.content }) })] })] }, article.id));
}) }), photosRenderer({ photos, noContent: false })] }));
}